Help me with this afk system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me with this afk system (
/showthread.php?tid=364673)
Help me with this afk system -
Gamer_007 - 31.07.2012
Frineds here is my auto afk but it not working properly.THe code is below
Code:
#include <a_samp>
#define FILTERSCRIPT
new AFK[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("CheckAFK", 1000, true);
}
// ...
public OnPlayerUpdate(playerid)
{
if(AFK[playerid] > 3)
{
// This player just came back from being AFK
}
AFK[playerid] = 0;
}
// ...
forward CheckAFK();
public CheckAFK()
{
for(new i = 0; i != MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
AFK[i] ++;
if(AFK[i] == 3)
{
}
}
}
Re: Help me with this afk system -
doreto - 31.07.2012
of course it will not work you check who is connect to server and give him afk= 1 and check if player move that time
Re: Help me with this afk system -
Gamer_007 - 31.07.2012
can u explain me in code doreto
Re: Help me with this afk system -
DarkB0y - 31.07.2012
https://sampforum.blast.hk/showthread.php?tid=354263
try this it may help.
Re: Help me with this afk system -
Gamer_007 - 31.07.2012
Some more help plz