Help me with this afk system
#1

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)
        {
            
        }
    }
}
Reply
#2

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
Reply
#3

can u explain me in code doreto
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=354263

try this it may help.
Reply
#5

Some more help plz
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)