13.02.2011, 22:23
Well, for one thing, there is a far easier way to see if someone is paused using OnPlayerUpdate and a Timer, for example:
This works because OnPlayerUpdate is no longer called when the player is paused, however the timer is still being called, which means that the variable isn't being set to false, but it will be set to true, so within 2 runs of the timer, the player will be recognized as paused.
Note that this is only an example.
Also if I were you, I'd forget about the 3D Text Labels and just use SetPlayerChatBubble for the pause message
pawn Код:
new bool:bPaused[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("pauseCheck", 1000, true);
return 1;
}
public pauseCheck()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(bPaused[i]) SetPlayerChatBubble(playerid, "Paused", 0xFF0000FF, 100.0, 1000);
bPaused[i] = true;
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
bPaused[playerid] = false;
return 1;
}
Note that this is only an example.
Also if I were you, I'd forget about the 3D Text Labels and just use SetPlayerChatBubble for the pause message

