Rejail help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rejail help (
/showthread.php?tid=153080)
Rejail help -
MWF2 - 07.06.2010
I have a rejail code that was made by Baked - Banana (Awesome scripter

)
I am trying to edit it so that if a player jail evades (logs out when they get jailed) they will be rejailed onplayerspawn. That works fine and everything BUT
I am now trying to make it so that they will be rejailed onplayerspawn but 5 seconds after they spawn instead of right away.
They get sent to jail in 5 seconds like they should, and it works, but they keep getting jailed over and over after 5 seconds instead of once. How can i stop this timer when they have been jailed already?
heres my code:
pawn Код:
forward ReJailTime(playerid);
public ReJailTime(playerid)
{
if(IsSpawned[playerid] == 1) {
if(JailTime[playerid]){
SetPlayerInterior(playerid,10);
SetPlayerPos(playerid, 219.5331,111.1658,999.0156);
SetPlayerVirtualWorld(playerid,0);
SendClientMessage(playerid,0xFF7F50AA,"This is what happens when you leave the server while in jail.");
Jailed[playerid] =1;
StoleCopCarRecent[playerid] =0;
triedtoescaperecent[playerid] =1;
ResetPlayerWeapons(playerid);
JailTimeServed[playerid] =0;
}
}
}
pawn Код:
SetTimer("ReJailTime",5000,1);
Re: Rejail help -
Johndaone - 07.06.2010
Just do a new IsPlayerJailed[MAX_PLAYERS];
Then check if his IsPlayerJailed is 0, then send him to jail and make it 1.
Then when we gets out from jail set it back to 0
if(IsPlayerJailed[playerid] == 0)
Re: Rejail help -
MWF2 - 07.06.2010
Lol sorry, what??
Can you show me what you mean?....
Re: Rejail help -
Johndaone - 07.06.2010
Sorry.. Very tired just been at a LAN all night and haven't been sleeping, test this code if its not working ill do one that works when i wake up
http://pastebin.com/6MVx7hCx
//edit
Remember when the players gets unjailed ( I did not make that ) then remember to set the IsPlayerJailed to 0 again so the timer will start if he gets jailed and tries to escape