Is it possible to auto kick paused players without using onplayerupdate?
#7

Quote:
Originally Posted by BenzoAMG
View Post
pawn Code:
public OnPlayerSpawn(playerid)
{
    SetTimerEx("AFKCheck", 300000, false, "i", playerid);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    KillTimer(AFKCheck(playerid));
    SetTimerEx("AFKCheck", 300000, false, "i", playerid);
    return 1;
}

public OnPlayerText(playerid, text[])
{
    KillTimer(AFKCheck(playerid));
    SetTimerEx("AFKCheck", 300000, false, "i", playerid);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    KillTimer(AFKCheck(playerid));
    SetTimerEx("AFKCheck", 300000, false, "i", playerid);
    return 1;
}

forward AFKCheck(playerid);
public AFKCheck(playerid)
{
    new string[80];
    format(string, sizeof(string), "Player %s has been kicked | Reason: Away From Keyboard", playername);
    SendClientMessageToAll(0xFF0000FF, string);
    Kick(playerid);
    return 1;
}
Basically, the code above, sets a timer for 5 minutes, and whenever the player does something like move, type a command or speak, the timer will reset.
I think this is worse than onplayerupdate lol.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)