Played time ( non A.F.K )
#1

I'm creating a giftbox script buy i would like to make it accesable once 5 hours played ingame , not just by afk-ing .
So my question is how could i keep track of the actually played time ?
afk means when the player is not moving for more than 10 mins and not on the esc menu . or any other way of afk-ing .
Reply
#2

PHP код:
new pLastUpdate[MAX_PLAYERS];

public 
OnPlayerUpdate(playerid)
{
    
pLastUpdate[playerid] = gettime();
    return 
1;
}

stock IsPlayerTabbed(playerid)
{
    if(
pLastUpdate[playerid] < gettime())
        return 
1;
        
    return 
0;

Use that function to detect if player is AFK or not (Check if the player is AFK when adding the playing hours)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)