Little problem with detecting if a player is paused
#3

I was just searching for detect pause thing.

I just thought about this:

pawn Код:
public OnPlayerConnect(playerid)
{

  SetPVarInt(playerid, "pause", 0);
  SetTimerEx("Paused", 1000, 1, "i", playerid);
  //ofc could be given an ID to be killed on exit or on gamemode exit, but i'm just making an example
  return 1;
}

public OnPlayerUpdate(playerid)
{
  SetPVarInt(playerid, "pause", 0);
  return 1;
}

forward Paused(playerid);
public Paused(playerid)
{
  if( GetPVarInt(playerid, "pause") != 0 ) printf("%i is paused", playerid);
  SetPVarInt(playerid, "pause", 1);
  return 1;
}
A pretty basic example, what do you guys think ? I think it works just fine .
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: 1 Guest(s)