12.08.2014, 14:12
how am i able to make 1 timer that works for multiple players
for example, i got an arrest command that sends a player to jail for 30 seconds and then unjails them once the 30 seconds is over but theres a bug, if i arrest another player 15 seconds after, they both get released from jail at the same time.
i've been trying to fix this for a while and yet, i can't. here is the bits of code:
up top
the timer itself
public
how can i make the timer run individually for all players in jail
for example, i got an arrest command that sends a player to jail for 30 seconds and then unjails them once the 30 seconds is over but theres a bug, if i arrest another player 15 seconds after, they both get released from jail at the same time.
i've been trying to fix this for a while and yet, i can't. here is the bits of code:
up top
Код:
forward UnJail();
Код:
SetTimerEx("UnJail", 60000, false, "i", playerid);
Код:
public UnJail() { for(new i; i < MAX_PLAYERS; i++) { if(jailed[i] == 1) { new pname[MAX_PLAYER_NAME]; new string[60]; GetPlayerName(i, pname, sizeof(pname)); SetPlayerPos(i, 255.2078,86.6854,1002.4453); SetPlayerInterior(i, 6); SetPlayerFacingAngle(i, 90); format(string, sizeof(string), "%s (%d) has been Released from Jail.", pname, i); SendClientMessageToAll(0xFFFFFFFF, string); jailed[i] = 0; } } }