AFK Check
#1

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", -130.0,40.0,10.0,40.00);
        
Attach3DTextLabelToPlayer(afkplayer[playerid], playerid0.00.00.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
Reply
#2

Well it would work if the player types this command 5 times.
Shouldn't AFK variable be like this?
pawn Код:
AFK[playerid] = 5;
Reply
#3

PHP код:
TimerAFK[playerid] = SetTimerEx("AFKTimer"1000true"i"playerid); 
AFK[playerid]++ in 1 second
Reply
#4

if 100 player join your server, you have 100 timer !
just set 1 timer and make a loop !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)