AFK Check - 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: AFK Check (
/showthread.php?tid=552831)
AFK Check -
AlexeyTrekkkk - 26.12.2014
Hello. I have problem, i can not do AFK system.
PHP код:
fCallBack::AFKTimer(playerid)
{
AFK[playerid]++;
if(AFK[playerid] == 5)
{
afkplayer[playerid] = Create3DTextLabel("{66cc33}AFK: {FFFFFF}00:00", -1, 30.0,40.0,10.0,40.0, 0);
Attach3DTextLabelToPlayer(afkplayer[playerid], playerid, 0.0, 0.0, 0.1);
}
else if(AFK[playerid] < 5)
{
Delete3DTextLabel(afkplayer[playerid]);
}
return 1;
}
In public OnPlayerUpdate - AFK[playerid] = 0;
but, system dont working, 3D text dont appears, and this public is 1 second timer. Help me please and exuseme for my English
Re: AFK Check -
dominik523 - 26.12.2014
Well it would work if the player types this command 5 times.
Shouldn't AFK variable be like this?
Re: AFK Check -
AlexeyTrekkkk - 26.12.2014
PHP код:
TimerAFK[playerid] = SetTimerEx("AFKTimer", 1000, true, "i", playerid);
AFK[playerid]++ in 1 second
Re: AFK Check -
M4D - 26.12.2014
if 100 player join your server, you have 100 timer !
just set 1 timer and make a loop !