Little problem with detecting if a player is paused
#4

I posted this about a week ago, it's probably the simplest way of detecting if a player is paused.

pawn Код:
new lastupdate[MAX_PLAYERS];
public OnPlayerUpdate(playerid) {
  lastupdate[playerid] = GetTickCount();
  return 1;
}
Then to check if they're paused, use:
pawn Код:
if(GetTickCount() > (lastupdate[playerid]+2000))
You can also define it like this, to have a simple function to use:
pawn Код:
#define IsPlayerPaused(%1) GetTickCount() > (lastupdate[%1]+2000)
You could also change the 2000 to something lower or higher.
Reply


Messages In This Thread
Little problem with detecting if a player is paused - by chaosnz - 05.06.2010, 07:00
Re: Little problem with detecting if a player is paused - by Calgon - 05.06.2010, 07:03
Re: Little problem with detecting if a player is paused - by cmg4life - 16.06.2010, 09:00
Re: Little problem with detecting if a player is paused - by ev0lution - 16.06.2010, 09:06

Forum Jump:


Users browsing this thread: 2 Guest(s)