PHP Kod:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new Float:bmTemelOrigin[33][3],bmOlumSay[33];
#define bmSure 20.0
public plugin_init() {
register_plugin
("AFK Olum",
"1.0",
"Berk");
RegisterHam(Ham_Spawn, "player","bePS",1);
register_message(get_user_msgid("ScoreAttrib"),"bmSkorTablosu");
}
public client_putinserver(bmID){
bmOlumSay[bmID] = 0;
}
public bmSkorTablosu(bmMsgID,bmDest,bmAlici) {
new bmID = get_msg_arg_int(1);
if(is_user_connected(bmID)) {
if(is_user_alive(bmID)){
set_msg_arg_int(2,ARG_BYTE,bmOlumSay[bmID] > 2 ? (1<<0):0);
}
}
}
public bePS(bmID){
if(bmOlumSay[bmID] > 2){
set_pev(bmID,pev_deadflag,DEAD_DEAD);
user_kill(bmID);
client_cmd(bmID,"chooseteam");
bmOlumSay[bmID] = 0;
}
remove_task(bmID);
if(is_user_alive(bmID)){
set_task(2.0,"beKonumAl",bmID);
}
}
public beKonumAl(bmID){
pev(bmID,pev_origin,bmTemelOrigin[bmID]);
set_task(bmSure,"beSonTest",bmID);
}
public beSonTest(bmID){
new Float:bmSuankiOrigin[3];
pev(bmID,pev_origin,bmSuankiOrigin);
if(bmTemelOrigin[bmID][0] == bmSuankiOrigin[0] &&
bmTemelOrigin[bmID][1] == bmSuankiOrigin[1]){
bmOlumSay[bmID] += 1;
}
}