[HELP] AFK Problems (May be related to the new foreach)
#4

If that's true, then it should be this:
pawn Код:
#define IsPlayerAfk(%0) (PlayerTick[%0]+5000 < GetTickCount())
public OnPlayerUpdate(playerid)
{
    PlayerTick[playerid]=GetTickCount();
    return 1;
}
public Check() // runs every second
{
    foreach (Player, playerid)
    {
                if(!IsPlayerAfk(playerid))
                {
                    // SOME ANTI-CHEAT CODE HERE WITH KICKS'N'BANS
                    if(!PlayerAfk[playerid])
                    {
                        DestroyDynamic3DTextLabel(PlayerLabel[playerid]);
                        PlayerAfk[playerid]=false;
                    }
                }
                else
                {
                    if(PlayerAfk[playerid])// This line
                    {
                        PlayerLabel[playerid] = CreateDynamic3DTextLabel("AFK", COLOR_INDIGO, 0.0,0.0,0.0, 10.0, playerid);
                        PlayerAfk[playerid]=true;
                    }
                }
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] AFK Problems (May be related to the new foreach) - by wups - 12.07.2012, 08:37
Re: [HELP] AFK Problems (May be related to the new foreach) - by clarencecuzz - 12.07.2012, 08:59
Re: [HELP] AFK Problems (May be related to the new foreach) - by Neil. - 12.07.2012, 09:04
Re: [HELP] AFK Problems (May be related to the new foreach) - by clarencecuzz - 12.07.2012, 09:08
Re: [HELP] AFK Problems (May be related to the new foreach) - by wups - 12.07.2012, 12:55
Re: [HELP] AFK Problems (May be related to the new foreach) - by wups - 13.07.2012, 08:25

Forum Jump:


Users browsing this thread: 1 Guest(s)