03.06.2018, 14:14
Delete twominutestimer and do my guide and it will work 100% for you:
Define this right under your includes:
Add this at OnPlayerUpdate:
Now use your new function 'IsPlayerAFKFor30Mins' or whatever you will call it in a global timer
example:
Explaination: if a player pressed ESC Button and 30 minutes has passed, that player will get kicked right away.
I hope it helped you or even learned you something new
Define this right under your includes:
Код:
#define IsPlayerAFKFor30Mins(%1) GetTickCount() > (lastupdate[%1]+60*1000*30) // 30 = 30 Minutes new lastupdate[MAX_PLAYERS];
Код:
lastupdate[playerid] = GetTickCount();
example:
Код:
SetTimer("CheckAFKPlayers",5000,1); forward CheckAFKPlayers(); public CheckAFKPlayers() foreach(Player,i) if(IsPlayerAFKFor30Mins(i)) Kick(i);
I hope it helped you or even learned you something new
