What's wrong with this AFK kicker?
#1

I run this on a 10 second timer

pawn Код:
AFK[playerid] += 1;
        if(AFK[playerid] > 1)
        {
            if(AFK[playerid] > 2)
            {
                new str[25];format(str, 25, "AFK (%d seconds)", AFK[playerid]*10);
                Update3DTextLabelText(AFKlabel[playerid], 0xFF000000, str);
                return 1;
            }
            if(AFK[playerid] >= 120)
            {
                KickPlayer(playerid,"SYSTEM","AFK");
                return 1;
            }
            else
            {
                AFKlabel[playerid] = Create3DTextLabel("AFK (20 seconds)", 0xFF000000, 30.0, 40.0, 50.0, 40.0, 0, 0);
                Attach3DTextLabelToPlayer(AFKlabel[playerid], playerid, 0.0, 0.0, 0.5);
            }
        }
And this is my OnPlayerUpdate
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(AFK[playerid] > 1)
    {
        Delete3DTextLabel(AFKlabel[playerid]);
    }
    AFK[playerid] = 0;
}
When I go AFK, the 3D label isn't shown :/
Reply


Messages In This Thread
What's wrong with this AFK kicker? - by Makaveli93 - 11.08.2012, 12:03
Re: What's wrong with this AFK kicker? - by jeremy8810 - 11.08.2012, 12:27
Respuesta: What's wrong with this AFK kicker? - by [DOG]irinel1996 - 11.08.2012, 12:32

Forum Jump:


Users browsing this thread: 1 Guest(s)