Jump to content

SetplayerUnjail problema.


PieceRo

Recommended Posts

Buna seara, am un server ce dispune de playeri , dar totusi sunt cam multe restarturi pe zi pentru problema asta.

La un momentdat , timpul la jail find tutorial etc se blocheaza. In log e ceva legat de setplayerunjail si array out of budding sau ceva de gen ( nu sunt scripter bun ).

Am intrebat scripteri marisori si nimeni nu a gasit o explicat

aveti aici comanda si am rugamintea de a ma ajuta , ofer si ceva in schimb ( paysafe ) daca problema se rezolva , pentru ca am nevoie.

function SetPlayerUnjail()
{
    new string[300];
    foreach(new i : Player)
    {
        if(IsPlayerConnected(i))
        {
            new level = PlayerData[pLevel];
            if(level >= 0 && level <= 2) { PlayerData[pPayCheck] += 10; }
            else if(level >= 3 && level <= 4) { PlayerData[pPayCheck] += 11; }
            else if(level >= 5 && level <= 6) { PlayerData[pPayCheck] += 12; }
            else if(level >= 7 && level <= 8) { PlayerData[pPayCheck] += 13; }
            else if(level >= 9 && level <= 10) { PlayerData[pPayCheck] += 14; }
            else if(level >= 11 && level <= 12) { PlayerData[pPayCheck] += 15; }
            else if(level >= 13 && level <= 14) { PlayerData[pPayCheck] += 16; }
            else if(level >= 15 && level <= 16) { PlayerData[pPayCheck] += 17; }
            else if(level >= 17 && level <= 18) { PlayerData[pPayCheck] += 18; }
            else if(level >= 19 && level <= 20) { PlayerData[pPayCheck] += 19; }
            else if(level >= 21) { PlayerData[pPayCheck] += 20; }
            if(PlayerData[pJailed] > 0)
            {
                if(PlayerData[pJailTime] > 0 && WantLawyer == 0)
                {
                    PlayerData[pJailTime]--;
                    format(string, sizeof(string),"~y~Time Left in Jail: ~n~~w~%d Seconds.",PlayerData[pJailTime]);
                    TextDrawSetString(JailTD,string);//jail
                }
                if(PlayerData[pJailTime] <= 0 && WantLawyer == 0)
                {
                    PlayerData[pJailTime] = 0;
                    if(PlayerData[pJailed] == 1)
                    {
                        SetPlayerInterior(i, 0);
                        SetPlayerPos(i,1546.4282,-1675.6783,13.5623);
                    }
                    else if(PlayerData[pJailed] == 2)
                    {
                        SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
                        SetPlayerInterior(i, 0);
                        SetPlayerPos(i, 90.2101,1920.4854,17.9422);
                    }
                    PlayerData[pJailed] = 0;
                    SendClientMessage(i, COLOR_GRAD1,"   You have paid your debt to society.");
                    format(string, sizeof(string), "~g~Freedom~n~~w~Try to be a better citizen");
                    GameTextForPlayer(i, string, 5000, 1);
                    if(gTeam == 4) { gTeam = 3; }
                    ClearCrime(i);
                    SetPlayerToTeamColor(i);
                    TextDrawHideForPlayer(i, JailTD);
                    SetPlayerVirtualWorld(i, 0);
                }
            }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.