Kill AFk player
#8

pawn Code:
new AntiAFK[MAX_PLAYERS];
new AFKTIMER[MAX_PLAYERS];

#define MAX_AFK_TIME 5

forward OnPlayerAFKcheck(playerid)
{
    AntiAFK[playerid]++;
    if(AntiAFK[playerid]>MAX_AFK_TIME)
    {
        // ur code
        //SetPlayerHealth(playerid,0.0);
    }
}

public OnPlayerConnect(playerid)
{
    AFKTIMER[playerid]=SetTimerEx("OnPlayerAFKcheck",1000,true, "d", playerid);
    return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
    KillTimer(AFKTIMER[playerid]);
    AntiAFK[playerid]=0;
    return 1;
}
public OnPlayerUpdate(playerid)
{
    AntiAFK[playerid]=0;
    return 1;
}
Reply


Messages In This Thread
Kill AFk player - by buburuzu19 - 12.11.2014, 19:48
Re: Kill AFk player - by BornHuman - 12.11.2014, 19:51
Re: Kill AFk player - by zT KiNgKoNg - 12.11.2014, 19:56
Re: Kill AFk player - by buburuzu19 - 12.11.2014, 20:04
Re: Kill AFk player - by buburuzu19 - 12.11.2014, 20:06
Re: Kill AFk player - by BornHuman - 12.11.2014, 20:06
Re: Kill AFk player - by DavidBilla - 12.11.2014, 23:27
Re: Kill AFk player - by Quickie - 13.11.2014, 04:47

Forum Jump:


Users browsing this thread: 2 Guest(s)