problem on kick afk after 30min
#3

Delete twominutestimer and do my guide and it will work 100% for you:

Define this right under your includes:
Код:
#define IsPlayerAFKFor30Mins(%1) GetTickCount() > (lastupdate[%1]+60*1000*30) // 30 = 30 Minutes
new lastupdate[MAX_PLAYERS];
Add this at OnPlayerUpdate:
Код:
lastupdate[playerid] = GetTickCount();
Now use your new function 'IsPlayerAFKFor30Mins' or whatever you will call it in a global timer
example:

Код:
SetTimer("CheckAFKPlayers",5000,1);
forward CheckAFKPlayers();
public CheckAFKPlayers() foreach(Player,i) if(IsPlayerAFKFor30Mins(i)) Kick(i);
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
Reply


Messages In This Thread
problem on kick afk after 30min - by marshmallow - 03.06.2018, 04:52
Re: problem on kick afk after 30min - by Livity - 03.06.2018, 06:36
Re: problem on kick afk after 30min - by DeathCore - 03.06.2018, 14:14
Re: problem on kick afk after 30min - by DeathCore - 03.06.2018, 17:55
Re: problem on kick afk after 30min - by DeathCore - 03.06.2018, 19:06
Re: problem on kick afk after 30min - by GTLS - 04.06.2018, 09:28

Forum Jump:


Users browsing this thread: 1 Guest(s)