Rejail help
#1

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);
Reply
#2

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)
Reply
#3

Lol sorry, what??


Can you show me what you mean?....
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)