17.02.2014, 09:28
The thing is.. The timer gets bugged or something.. If you tab out for 5 minutes it adds like 1-2 hours to pHours
I tried this, but it just spams the message of afk, even when not afk?
Using the include now, when does it classify the player as afk?
pawn Код:
public OnPlayerUpdate(playerid)
{
AFKCheck[playerid] = 5;
SetTimerEx("AfkTimer", 1000, 1, "i", playerid);
return 1;
}
forward AfkTimer(playerid);
public AfkTimer(playerid)
{
AFKCheck[playerid]--;
if (AFKCheck[playerid] < 3)
{
AFK[playerid] = 1;
SendClientMessage(playerid, COLOR_ORANGE, "Debug - Now afk");
}
else
{
AFK[playerid] = 0;
}
}
Using the include now, when does it classify the player as afk?