16.06.2010, 09:00
I was just searching for detect pause thing.
I just thought about this:
A pretty basic example, what do you guys think ? I think it works just fine .
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;
}