Jailed help?
#1

So here is my code for when a player is jailed by police:

pawn Код:
new pwl = GetPlayerWantedLevel(ID);
    if(pwl == 3)
    {
        format(string, sizeof(string), "Police Officer %s (%d) has arrested wanted suspect %s (%d).", pname, playerid, opname, ID);
        SendClientMessageToAll(COLOR_BLUE, string);
        format(string, sizeof(string), "[POLICE RADIO] Suspect %s (%d) has been sent to jail.", opname, ID);
        SendCopMessage(string);
        GivePlayerMoney(playerid, 3000);
        IncreaseScore(playerid, 2);
        SetPVarInt(ID, "JailTime", 45);
        SetPlayerInterior(ID, 10);
        new rnd = random(sizeof(PrisonSpawn));
        SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
        SendClientMessage(playerid, COLOR_GREY, "**LOS SANTOS PRISON**");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
        TogglePlayerControllable(ID, 1);
        SetPlayerWantedLevel(ID, 0);
        return 1;
    }
So on his/her screen it will show the jail time counting down. When jail time go to "0" the player in jail will be released to my desired spot. But when the player gets out of jail, the timer on the screen still say JAIL TIME -1, JAIL TIME -2, JAIL TIME -3 and it will keep on going to -9999999+ and when the player moves, he/she will be put back to the "out of jail" location and it will keep on counting down and teleporting it back to the respawn position. Can someone please help me on this or what I'm doing wrong? Thanks
Reply


Messages In This Thread
Jailed help? - by TheMightyEddy - 11.04.2012, 05:27
Re: Jailed help? - by TheMightyEddy - 11.04.2012, 05:37
Re: Jailed help? - by Cjgogo - 11.04.2012, 07:16
Re: Jailed help? - by HighFlyer - 26.09.2012, 20:06

Forum Jump:


Users browsing this thread: 2 Guest(s)