How to detect if player is in menu/tabbed ?
#5

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Here's my AutoAFK detector which has been created as an include for my personal use a long time ago. However, I've just added it on GitHub now and you can use it in case if you want.

https://github.com/Lordzy/AutoAFK

You can use either the callbacks - OnPlayerPause and OnPlayerResume or IsPlayerPaused function which would return true if paused and false if not paused.

There might be better AFK detectors, I used this for my personal use before. It works well though.
Thanks all I've done is just simple added a timer to detect if that players onupdateplayer function was called or not. Should work just fine. If it's not called I'll just set a variable for PlayerPaused[playerid]

EDIT: Thanks again for the help I did +rep you

EDIT2:

pawn Код:
forward PauseCheck();
public PauseCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(OnPlayerUpdate(i) == 0)
            {
                PlayerPaused[i] = 1;
            }
            if(OnPlayerUpdate(i) == 1)
            {
                PlayerPaused[i] = 0;
            }
        }
    }
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)