Need another help - jail timer
#5

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:
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;
}
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
Reply


Messages In This Thread
Need another help - jail timer - by Striker_Moe - 13.09.2009, 15:36
Re: Need another help - jail timer - by Striker_Moe - 13.09.2009, 16:31
Re: Need another help - jail timer - by Striker_Moe - 14.09.2009, 14:40
Re: Need another help - jail timer - by Calgon - 14.09.2009, 14:50
Re: Need another help - jail timer - by Clavius - 14.09.2009, 14:57
Re: Need another help - jail timer - by Striker_Moe - 14.09.2009, 16:57

Forum Jump:


Users browsing this thread: 1 Guest(s)