Offline player help
#2

I would do something like this

Код:
forward AFKToggle(playerid);
public AFKToggle(playerid)
{
      PlayerInfo[playerid][AFK] = 1;
}

public OnPlayerUpdate(playerid)
{
         PlayerInfo[playerid][AFK] = 0;

         //// YOUR CODE HERE

         SetTimerEx("AFKToggle", 2000, false, "i", playerid);
}
OnPlayerUpdate is called very often and the timer at the end will set your player back to AFK 2 seconds after it is last called. I haven't tested this myself but hopefully when the player tabs out, the timer will still get called and they will still be set to AFK because OnPlayerUpdate is not called to set them back to not AFK as they are tabbed out.
Reply


Messages In This Thread
Offline player help - by kalanerik99 - 14.07.2015, 09:29
Re: Offline player help - by HarrisonC - 14.07.2015, 09:39
Re: Offline player help - by kalanerik99 - 14.07.2015, 12:35
Re: Offline player help - by Virtual1ty - 14.07.2015, 15:13
Re: Offline player help - by kalanerik99 - 14.07.2015, 17:16
Re: Offline player help - by Virtual1ty - 14.07.2015, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)