Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Check unjail

$
0
0
Hello!
I'm have a big problem:
I'm created a check for player is jailed
Code:

Variables:
unjailtimer,
PlayerText:Jailtime[MAX_PLAYERS],
Under ongamemodeinit
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);---------check
Under GameModeExitFunc:
KillTimer(unjailtimer);
The public "SetPlayerUnjail"(IsToCheck)
public SetPlayerUnjail()
{
        foreach(Player, i)
        {
        if(Player[i][Jailed] > 0)
        {
                if(Player[i][JailTime] > 0)
                {
                        Player[i][JailTime]--;
                        PlayerTextDrawShow(i, Jailtime[i]);
                        new string3[60];
                        format(string3,sizeof(string3),"ELIBERAT IN: ~r~%d MINUTE", Player[i][JailTime]/60+1);
                        PlayerTextDrawSetString(i, Jailtime[i], string3);
                }
        }
        if(Player[i][JailTime] <= 0)
        {
                Player[i][JailTime] = 0;
                if(Player[i][Jailed] == 1)
                        {
                                SetPlayerInterior(i, 6);
                            SetPlayerPos(i, 268.7461,76.8184,1001.0391);
                        }
                if(Player[i][Jailed] == 2)
                        {
                        SetPlayerInterior(i, 0);
                        SetPlayerVirtualWorld(i, 0);
                        SetPlayerPos(i, 1800.1581,-1865.7731,13.5722);
                        }
        }
        Player[i][Jailed] = 0;
        SendClientMessage(i, COLOR_WHITE, "Ti-ai ispasit pedeapsa,sa nu mai faci vreo boacana.");----Line 9442
        SetPlayerSpecialAction(i,SPECIAL_ACTION_NONE);
        PlayerTextDrawHide(i, Jailtime[i]);
        TogglePlayerControllable(i, 1);
        }
}

From second to second I display the message setplayerunjail (line 9442)
Why?
(for help: Line 9442 translated is "Your time is up! You have been relased from jail/prison.")
(sorry for my bad english)
EDIT: If i'm enter in jail,im released in 1 second from jail!

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>