14.09.2009, 14:57
If tkjail is what releases the player from jail, then it should have a playerid parameter.
public tkjail(playerid)
In this case, SetTimerEx is needed insted of SetTimer.
Also, you should use a variable to check if the player is in prison, so you can later use it do deny teleporting or suicide for the player.
Here is an example code:
You'd need to add PlayerInPrison[playerid] = true; when the player gets jailed, and don't forget to set it to false on OnPlayerDisconnect(playerid), in case someone quits while in jail
public tkjail(playerid)
In this case, SetTimerEx is needed insted of SetTimer.
Also, you should use a variable to check if the player is in prison, so you can later use it do deny teleporting or suicide for the player.
Here is an example code:
pawn Код:
new bool:PlayerInPrison[MAX_PLAYERS];
forward tkjail(playerid);
[...]
public tkjail(playerid)
{
SetPlayerPos(playerid, X, Y, Z); // coordinates here should be the position where you want the player to be released
SetPlayerInterior(playerid, 0); // or other, if needed
PlayerInPrison[playerid] = false;
}

