Question

Приветствую. Сделал команду /jail и /arrest. Были проблемы с /jail щас исправил и вроде норм работает, а вот /arrest нет. пишет что посадил игрока но игрок всё ещё стоит на месте хоть есть кординаты. А так же любой игрок который заходит в игру им дается скин тюремьщика ид 42

Видео - /jail

Видео - /arrest

Спойлер

else if(strcmp(cmd, "/jail"true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(pData[playerid][pAdmin] < 3return 1;
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        new acter;
        new time;
        acter = ReturnUser(tmp);
        if(pData[acter][pJail] > 0return SendErr(playerid, "Äàííûé èãðîê óæå â òþðüìå");
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        time = strval(tmp);
        tmp = strrest(cmdtext,idx);
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        
        new string[256];
        ResetPlayerWeapons(acter);
        pData[acter][pJail] = time*60;
        pData[acter][pPrison] = 1;
        
        if (pData[acter][pJail])
        {
            switch (pData[acter][pPrison])
                {
                        case 1:
                        {
                            new JailedLSPD = random(4)+1;
                            switch(JailedLSPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,1);
                            SetPlayerInterior(acter,10);
                        }
                        case 2:
                        {
                            new JailedSFPD = random(4)+1;
                            switch(JailedSFPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,2);
                            SetPlayerInterior(acter,10);
                        }
                        case 3:
                        {
                            new JailedLVPD = random(4)+1;
                            switch(JailedLVPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,3);
                            SetPlayerInterior(acter,10);
                        }
                        case 4:
                        {
                            new adminjailed = random(4)+1;
                            switch(adminjailed)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,1);
                            SetPlayerInterior(acter,10);
                        }
                }
        }
        TogglePlayerControllable(acter,1);
        SetPlayerSkin(acter, 42);
        format(string, sizeof(string), "Àäìèíèñòðàòîð %s ïîñàäèë Âàñ â òþðüìó íà %d ìèíóò. Ïðè÷èíà: %s", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, COLOR_LIGHTRED, string);
        format(string, sizeof(string), "• {FFC800}[Ïîäñêàçêà] {ffffff}×òîáû ïîñìîòðåòü ñêîëüêî Âàñ îñòàâëîñü ñèäåòü â òþðüìå ââåäèòå êîìàíäó {FFC800}/ptime", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, -1, string);
        format(string, sizeof(string), "Âû ïîñàäèëè %s â òþðüìó", pData[acter][pNickname]);
        SendClientMessage(playerid, COLOR_LIGHTRED, string);
        format(string,sizeof(string),"(A) Àäìèíèñòðàòîð %s[%d] ïîñàäèë èãðîêà %s[%d] â òþðüìó íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],playerid,pData[acter][pNickname],acter,time,tmp);
        AdminChat(CGRAY,string);
        UpdatePlayerData(acter,"wanted",pData[acter][pWanted]);
        new stringer[255];
        format(stringer, sizeof(stringer), "Àäìèíèñòðàòîð %s âûäàë ÊÏÇ èãðîêó %s íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],pData[acter][pNickname],time,tmp);
        SendLog(stringer);
        return 1;
    }

 

Спойлер

    if(!strcmp(cmd,"/arrest",true))
    {
          if(pData[playerid][pFraction] != 9 && pData[playerid][pFraction] != 12return SendClientMessage(playerid,CGRAY,"Это фунция доступна только для МВД");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendPods(playerid, "/arrest (ID - Игрока)");
        new id,time,mes[350],money = RandomEx(100,900);
        id = ReturnUser(tmp);
        if(!Nearjail(playerid) || !Nearjail(id)) return SendClientMessage(playerid,CGRAY,"Вы должны находиться у входа к камерам.");
        if(!pData[id][pWanted]) return SendClientMessage(playerid,CGRAY,"Этот игрок не совершал преступление");
        if(pData[id][pJail]) return SendClientMessage(playerid,CGRAY,"Этот игрок уже в КПЗ");
        if(id == playerid) return 1;
        if(pData[id][pWanted] == 6){ time = 30; }
        if(pData[id][pWanted] == 5){ time = 25; }
        if(pData[id][pWanted] == 4){ time = 20; }
        if(pData[id][pWanted] == 3){ time = 15; }
        if(pData[id][pWanted] == 2){ time = 10; }
        if(pData[id][pWanted] == 1){ time = 5; }
        if(pTemp[id][pCuffer] != INVALID_PLAYER_ID)
        {
            new cuffer = pTemp[id][pCuffer];
            SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(id,0);
            pTemp[id][pCuffer] = INVALID_PLAYER_ID;
            pTemp[id][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffer] = INVALID_PLAYER_ID;
        }
        if (pData[playerid][pJail])
        {
            switch (pData[playerid][pPrison])
                {
                        case 1:
                        {
                            new JailedLSPD = random(2)+1;
                            switch(JailedLSPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(playerid,1);
                            SetPlayerInterior(playerid,10);
                        }
                        case 2:
                        {
                            new JailedSFPD = random(2)+1;
                            switch(JailedSFPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,2);
                            SetPlayerInterior(id,10);
                        }
                        case 3:
                        {
                            new JailedLVPD = random(2)+1;
                            switch(JailedLVPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,3);
                            SetPlayerInterior(id,10);
                        }
                        case 4:
                        {
                            new adminjailed = random(2)+1;
                            switch(adminjailed)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,1);
                            SetPlayerInterior(id,10);
                        }
                }
          }
        SetPlayerSkin(id, 42);
        pData[id][pJail] = time*60;
        pData[id][pPrison] = RandomEx(1,3);
        pData[id][pWanted] = 0;
        SetPlayerWantedLevel(id, 0);
        UpdatePlayerData(id,"wanted",pData[id][pWanted]);
        format(mes,sizeof(mes),"Вы были помещены в КПЗ сотрудником %s на %d минут",pData[playerid][pNickname],time);
        SendClientMessage(id,CBADINFO,mes);
        pData[playerid][pMoney] += money;
        format(mes,sizeof(mes),"Вы получили премию {009900}%d",money);
        SendClientMessage(playerid,CINFO,mes);
        format(mes,sizeof(mes),"Вы поместили %s в КПЗ",pData[id][pNickname]);
        SendClientMessage(playerid,CINFO,mes);
        return 1;
    }

 

 

Спойлер

public OnPlayerSpawn(playerid)

if (pData[playerid][pJail])
    {
        switch (pData[playerid][pPrison])
            {
                    case 1:
                    {
                        new JailedLSPD = random(4)+1;
                        switch(JailedLSPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                    }
                    case 2:
                    {
                        new JailedSFPD = random(4)+1;
                        switch(JailedSFPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,2);
                        SetPlayerInterior(playerid,10);
                    }
                    case 3:
                    {
                        new JailedLVPD = random(4)+1;
                        switch(JailedLVPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,3);
                        SetPlayerInterior(playerid,10);
                    }
                    case 4:
                    {
                        new adminjailed = random(4)+1;
                        switch(adminjailed)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                    }
            }
    }
    TogglePlayerControllable(playerid,1);
    SetPlayerSkin(playerid, 42);
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    
    if (pData[playerid][pWanted])
    {
        switch (pData[playerid][pPrison])
            {
                    case 1:
                    {
                        new JailedLSPD = random(4)+1;
                        switch(JailedLSPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 1;
                    }
                    case 2:
                    {
                        new JailedSFPD = random(4)+1;
                        switch(JailedSFPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,2);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 2;
                    }
                    case 3:
                    {
                        new JailedLVPD = random(4)+1;
                        switch(JailedLVPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,3);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 3;
                    }
            }
    }
    return true;



public OnPlayerDeath(playerid, killerid, reason)

    if (pData[playerid][pJail])
    {
        switch (pData[playerid][pPrison])
            {
                    case 1:
                    {
                        new JailedLSPD = random(4)+1;
                        switch(JailedLSPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 1;
                    }
                    case 2:
                    {
                        new JailedSFPD = random(4)+1;
                        switch(JailedSFPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,2);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 2;
                    }
                    case 3:
                    {
                        new JailedLVPD = random(4)+1;
                        switch(JailedLVPD)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,3);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 3;
                    }
            }
    }

    ResetPlayerWeapons(playerid);
    TogglePlayerControllable(playerid,1);
    SetPlayerSkin(playerid, 42);
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    UpdatePlayerData(playerid,"wanted",pData[playerid][pWanted]);
    UpdatePlayerData(playerid,"jail",pData[playerid][pJail]);
    UpdatePlayerData(playerid,"prison",pData[playerid][pPrison]);

    SetPlayerWantedLevel(playerid,0);
    return 1;

 

 

Edited by keyl

Заметка от keyl , создано

3.2. Код больше 10 строк необходимо брать в теги "Код" и "Спойлер". Как это сделать рассказано в разделе "FAQ".

Устное предупреждение.

Share this post


Link to post

5 answers to this question

  • 0

@amazonite 

Попробуйте так:

Спойлер



else if(strcmp(cmd, "/jail"true) == 0)
    {
        if(pData[playerid][pAdmin] < 3return 1;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        new acter = ReturnUser(tmp);
        if(pData[acter][pJail] > 0return SendErr(playerid, "Äàííûé èãðîê óæå â òþðüìå");
        if(pData[acter][pWanted] == 0return SendErr(playerid, "Игрок не нахходится в розыске!");
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        new time = strval(tmp);
        tmp = strrest(cmdtext,idx);
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        ResetPlayerWeapons(acter);
        pData[acter][pJail] = time*5*60;
        pData[acter][pPrison] = 4;
        pData[acter][pWanted] = 0;
        UpdatePlayerData(acter,"wanted",pData[acter][pWanted]);
        if(rendom(2) == 0) SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
        else SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
        SetPlayerVirtualWorld(acter,1);
        SetPlayerInterior(acter,10);
        TogglePlayerControllable(acter, 1);
        SetPlayerSkin(acter, 42);
        new string[256];
        format(string, sizeof(string), "Àäìèíèñòðàòîð %s ïîñàäèë Âàñ â òþðüìó íà %d ìèíóò. Ïðè÷èíà: %s", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, COLOR_LIGHTRED, string);
        format(string, sizeof(string), "• {FFC800}[Ïîäñêàçêà] {ffffff}×òîáû ïîñìîòðåòü ñêîëüêî Âàñ îñòàâëîñü ñèäåòü â òþðüìå ââåäèòå êîìàíäó {FFC800}/ptime", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, -1, string);
        format(string, sizeof(string), "Âû ïîñàäèëè %s â òþðüìó", pData[acter][pNickname]);
        SendClientMessage(playerid, COLOR_LIGHTRED, string);
        format(string,sizeof(string),"(A) Àäìèíèñòðàòîð %s[%d] ïîñàäèë èãðîêà %s[%d] â òþðüìó íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],playerid,pData[acter][pNickname],acter,time,tmp);
        AdminChat(CGRAY,string);
        format(string, sizeof(string), "Àäìèíèñòðàòîð %s âûäàë ÊÏÇ èãðîêó %s íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],pData[acter][pNickname],time,tmp);
        SendLog(string);
        SpawnPlayer(actor);
        return 1;
    }


 

 

Спойлер

if(!strcmp(cmd,"/arrest",true))
    {
        if(pData[playerid][pFraction] != 9 && pData[playerid][pFraction] != 12return SendClientMessage(playerid,CGRAY,"Ýòà ôóíêöèÿ äîñòóïíà òîëüêî ñîòðóäíèêàì ÌÂÄ");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendPods(playerid, "/arrest (ID - èãðîêà)");
        new id,time,mes[350],money = RandomEx(100,900);
        id = ReturnUser(tmp);
        if(!Nearjail(playerid) || !Nearjail(id)) return SendClientMessage(playerid,CGRAY,"Âû äîëæíû íàõîäèòüñÿ ó âõîäà ê êàìåðàì");
        if(!pData[id][pWanted]) return SendClientMessage(playerid,CGRAY,"Ýòîò èãðîê íå ñîâåðøàë ïðåñòóïëåíèå");
        if(pData[id][pJail]) return SendClientMessage(playerid,CGRAY,"Ýòîò èãðîê óæå íàõîäèòñÿ â ÊÏÇ");
        if(id == playerid) return 1;
        pData[id][pJail] = pData[id][pWanted]*5*60;
        pData[id][pPrison] = RandomEx(1,3);
        if(pTemp[id][pCuffer] != INVALID_PLAYER_ID)
        {
            new cuffer = pTemp[id][pCuffer];
            SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(id,0);
            pTemp[id][pCuffer] = INVALID_PLAYER_ID;
            pTemp[id][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffer] = INVALID_PLAYER_ID;
        }
        if(rendom(2) == 0) SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
        else SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
        SetPlayerVirtualWorld(id, pData[id][pPrison]);
        SetPlayerInterior(id,10);
        SetPlayerSkin(id, 42);
        pData[id][pWanted] = 0;
        SetPlayerWantedLevel(id, 0);
        UpdatePlayerData(id,"wanted",pData[id][pWanted]);
        format(mes,sizeof(mes),"Âû áûëè ïîìåùåíû â ÊÏÇ ñîòðóäíèêîì ÏÄ %s íà %d ìèíóò",pData[playerid][pNickname],time);
        SendClientMessage(id,CBADINFO,mes);
        pData[playerid][pMoney] += money;
        format(mes,sizeof(mes),"Âû ïîëó÷èëè ïðåìèþ {009900}%d",money);
        SendClientMessage(playerid,CINFO,mes);
        format(mes,sizeof(mes),"Âû ïîìåñòèëè %s â ÊÏÇ",pData[id][pNickname]);
        SendClientMessage(playerid,CINFO,mes);
        SpawnPlayer(id);
        return 1;
    }

 

Спойлер

public OnPlayerSpawn(playerid)
{
    if (pData[playerid][pJail])
    {
        if(rendom(2) == 0) SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
        else SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
        if (pData[playerid][pPrison] != 4) SetPlayerVirtualWorld(playerid,pData[playerid][pPrison]);
        else SetPlayerVirtualWorld(playerid, 1);
        SetPlayerInterior(playerid,10);
        TogglePlayerControllable(playerid,1);
        SetPlayerSkin(playerid, 42);
    }
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    return true;
}

 

Спойлер

public OnPlayerDeath(playerid, killerid, reason)

if (pData[playerid][pJail])
    {
        if(random(2) == 0) SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
        else SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
        if(pData[playerid][pPrison] != 4) SetPlayerVirtualWorld(playerid,pData[playerid][pPrison]);
        else SetPlayerVirtualWorld(playerid, 1);
        SetPlayerInterior(playerid,10);
        ResetPlayerWeapons(playerid);
        TogglePlayerControllable(playerid,1);
        SetPlayerSkin(playerid, 42);        
        UpdatePlayerData(playerid,"wanted",pData[playerid][pWanted]);
        UpdatePlayerData(playerid,"jail",pData[playerid][pJail]);
        UpdatePlayerData(playerid,"prison",pData[playerid][pPrison]);
        SetPlayerWantedLevel(playerid,0);
    }
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    return 1;

 

Share this post


Link to post
  • 0
if(!strcmp(cmd,"/arrest",true))
    {
          if(pData[playerid][pFraction] != 9 && pData[playerid][pFraction] != 12return SendClientMessage(playerid,CGRAY,"Это фунция доступна только для МВД");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendPods(playerid, "/arrest (ID - Игрока)");
        new id,time,mes[350],money = RandomEx(100,900);
        id = ReturnUser(tmp);
        if(!Nearjail(playerid) || !Nearjail(id)) return SendClientMessage(playerid,CGRAY,"Вы должны находиться у входа к камерам.");
        if(!pData[id][pWanted]) return SendClientMessage(playerid,CGRAY,"Этот игрок не совершал преступление");
        if(pData[id][pJail]) return SendClientMessage(playerid,CGRAY,"Этот игрок уже в КПЗ");
        if(id == playerid) return 1;
        pData[id][pJail] = pData[id][pWanted]*5*60;
        pData[id][pPrison] = RandomEx(1,3);
        if(pTemp[id][pCuffer] != INVALID_PLAYER_ID)
        {
            new cuffer = pTemp[id][pCuffer];
            SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(id,0);
            pTemp[id][pCuffer] = INVALID_PLAYER_ID;
            pTemp[id][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffer] = INVALID_PLAYER_ID;
        }
        if (pData[playerid][pJail])
        {
            switch (pData[playerid][pPrison])
                {
                        case 1:
                        {
                            new JailedLSPD = random(2)+1;
                            switch(JailedLSPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(playerid,1);
                            SetPlayerInterior(playerid,10);
                        }
                        case 2:
                        {
                            new JailedSFPD = random(2)+1;
                            switch(JailedSFPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,2);
                            SetPlayerInterior(id,10);
                        }
                        case 3:
                        {
                            new JailedLVPD = random(2)+1;
                            switch(JailedLVPD)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,3);
                            SetPlayerInterior(id,10);
                        }
                        case 4:
                        {
                            new adminjailed = random(2)+1;
                            switch(adminjailed)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,1);
                            SetPlayerInterior(id,10);
                        }
                }
          }
        SetPlayerSkin(id, 42);
        pData[id][pWanted] = 0;
        SetPlayerWantedLevel(id, 0);
        UpdatePlayerData(id,"wanted",pData[id][pWanted]);
        format(mes,sizeof(mes),"Вы были помещены в КПЗ сотрудником %s на %d минут",pData[playerid][pNickname],time);
        SendClientMessage(id,CBADINFO,mes);
        pData[playerid][pMoney] += money;
        format(mes,sizeof(mes),"Вы получили премию {009900}%d",money);
        SendClientMessage(playerid,CINFO,mes);
        format(mes,sizeof(mes),"Вы поместили %s в КПЗ",pData[id][pNickname]);
        SendClientMessage(playerid,CINFO,mes);
        return 1;
    }

 

И так же в /jail, OnPlayerSpawn, OnPlayerDeath

замените:

new /*name*/ = random(4)+1;

На:

 

new /*name*/ = random(2)+1;

Edited by Sleash`en

Share this post


Link to post
  • 0

TS Posted (edited) · Report post

Ничего не происходит при /arrest. Появлвется текст и выдается скин игроку и дальше ничего не происходит, а так же при заходе в игру любому игроку выдается скин зека.

Команда /jail не работает на игрока с ИД 0 а так же допустим у игрока ИД 2, при /jail 2 30 ДМ игрок отправляется в КПЗ на 2 минуты, хотя я указал 30.

Фрапс Jail - click | click2

Фрапс arrest - click | click2

 

Спойлер

else if(strcmp(cmd, "/jail"true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(pData[playerid][pAdmin] < 3return 1;
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        new acter;
        new time;
        acter = ReturnUser(tmp);
        if(pData[acter][pJail] > 0return SendErr(playerid, "Äàííûé èãðîê óæå â òþðüìå");
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        time = strval(tmp);
        tmp = strrest(cmdtext,idx);
        if(!strlen(tmp)) return SendPods(playerid, "/jail (ID - èãðîêà) (êîëè÷åñòâî ìèíóò) (ïðè÷èíà)");
        
        new string[256];
        ResetPlayerWeapons(acter);
        pData[acter][pJail] = time*60;
        pData[acter][pPrison] = 1;
        
        if (pData[acter][pJail])
        {
            switch (pData[acter][pPrison])
                {
                        case 1:
                        {
                            new JailedLSPD = random(4)+1;
                            switch(JailedLSPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,1);
                            SetPlayerInterior(acter,10);
                        }
                        case 2:
                        {
                            new JailedSFPD = random(4)+1;
                            switch(JailedSFPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,2);
                            SetPlayerInterior(acter,10);
                        }
                        case 3:
                        {
                            new JailedLVPD = random(4)+1;
                            switch(JailedLVPD)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,3);
                            SetPlayerInterior(acter,10);
                        }
                        case 4:
                        {
                            new adminjailed = random(4)+1;
                            switch(adminjailed)
                            {
                                case 1: SetPlayerPos(acter,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(acter,81.6021);
                                case 2: SetPlayerPos(acter,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(acter,2.1597);
                            }
                            SetPlayerVirtualWorld(acter,1);
                            SetPlayerInterior(acter,10);
                        }
                }
        }
        TogglePlayerControllable(acter,1);
        SetPlayerSkin(acter, 42);
        format(string, sizeof(string), "Àäìèíèñòðàòîð %s ïîñàäèë Âàñ â òþðüìó íà %d ìèíóò. Ïðè÷èíà: %s", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, COLOR_LIGHTRED, string);
        format(string, sizeof(string), "• {FFC800}[Ïîäñêàçêà] {ffffff}×òîáû ïîñìîòðåòü ñêîëüêî Âàñ îñòàâëîñü ñèäåòü â òþðüìå ââåäèòå êîìàíäó {FFC800}/ptime", pData[playerid][pNickname], time, tmp);
        SendClientMessage(acter, -1, string);
        format(string, sizeof(string), "Âû ïîñàäèëè %s â òþðüìó", pData[acter][pNickname]);
        SendClientMessage(playerid, COLOR_LIGHTRED, string);
        format(string,sizeof(string),"(A) Àäìèíèñòðàòîð %s[%d] ïîñàäèë èãðîêà %s[%d] â òþðüìó íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],playerid,pData[acter][pNickname],acter,time,tmp);
        AdminChat(CGRAY,string);
        UpdatePlayerData(acter,"wanted",pData[acter][pWanted]);
        new stringer[255];
        format(stringer, sizeof(stringer), "Àäìèíèñòðàòîð %s âûäàë ÊÏÇ èãðîêó %s íà %d ìèíóò. (Ïðè÷èíà: %s)",pData[playerid][pNickname],pData[acter][pNickname],time,tmp);
        SendLog(stringer);
        return 1;
    }

 

 

Спойлер

if(!strcmp(cmd,"/arrest",true))
    {
        if(pData[playerid][pFraction] != 9 && pData[playerid][pFraction] != 12return SendClientMessage(playerid,CGRAY,"Ýòà ôóíêöèÿ äîñòóïíà òîëüêî ñîòðóäíèêàì ÌÂÄ");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendPods(playerid, "/arrest (ID - èãðîêà)");
        new id,time,mes[350],money = RandomEx(100,900);
        id = ReturnUser(tmp);
        if(!Nearjail(playerid) || !Nearjail(id)) return SendClientMessage(playerid,CGRAY,"Âû äîëæíû íàõîäèòüñÿ ó âõîäà ê êàìåðàì");
        if(!pData[id][pWanted]) return SendClientMessage(playerid,CGRAY,"Ýòîò èãðîê íå ñîâåðøàë ïðåñòóïëåíèå");
        if(pData[id][pJail]) return SendClientMessage(playerid,CGRAY,"Ýòîò èãðîê óæå íàõîäèòñÿ â ÊÏÇ");
        if(id == playerid) return 1;
        pData[id][pJail] = pData[id][pWanted]*5*60;
        pData[id][pPrison] = RandomEx(1,3);
        if(pTemp[id][pCuffer] != INVALID_PLAYER_ID)
        {
            new cuffer = pTemp[id][pCuffer];
            SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(id,0);
            pTemp[id][pCuffer] = INVALID_PLAYER_ID;
            pTemp[id][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffee] = INVALID_PLAYER_ID;
            pTemp[cuffer][pCuffer] = INVALID_PLAYER_ID;
        }
        if (pData[playerid][pJail])
        {
            switch (pData[playerid][pPrison])
                {
                        case 1:
                        {
                            new JailedLS = random(2)+1;
                            switch(JailedLS)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(playerid,1);
                            SetPlayerInterior(playerid,10);
                        }
                        case 2:
                        {
                            new JailedSF = random(2)+1;
                            switch(JailedSF)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,2);
                            SetPlayerInterior(id,10);
                        }
                        case 3:
                        {
                            new JailedLV = random(2)+1;
                            switch(JailedLV)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,3);
                            SetPlayerInterior(id,10);
                        }
                        case 4:
                        {
                            new adminjailed = random(2)+1;
                            switch(adminjailed)
                            {
                                case 1: SetPlayerPos(id,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(id,81.6021);
                                case 2: SetPlayerPos(id,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(id,2.1597);
                            }
                            SetPlayerVirtualWorld(id,1);
                            SetPlayerInterior(id,10);
                        }
                }
        }
        SetPlayerSkin(id, 42);
        pData[id][pWanted] = 0;
        SetPlayerWantedLevel(id, 0);
        UpdatePlayerData(id,"wanted",pData[id][pWanted]);
        format(mes,sizeof(mes),"Âû áûëè ïîìåùåíû â ÊÏÇ ñîòðóäíèêîì ÏÄ %s íà %d ìèíóò",pData[playerid][pNickname],time);
        SendClientMessage(id,CBADINFO,mes);
        pData[playerid][pMoney] += money;
        format(mes,sizeof(mes),"Âû ïîëó÷èëè ïðåìèþ {009900}%d",money);
        SendClientMessage(playerid,CINFO,mes);
        format(mes,sizeof(mes),"Âû ïîìåñòèëè %s â ÊÏÇ",pData[id][pNickname]);
        SendClientMessage(playerid,CINFO,mes);
        return 1;
    }

 

 

Спойлер

public OnPlayerSpawn(playerid)

if (pData[playerid][pJail])
    {
        switch (pData[playerid][pPrison])
            {
                    case 1:
                    {
                        new JailedLS = random(2)+1;
                        switch(JailedLS)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                    }
                    case 2:
                    {
                        new JailedSF = random(2)+1;
                        switch(JailedSF)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,2);
                        SetPlayerInterior(playerid,10);
                    }
                    case 3:
                    {
                        new JailedLV = random(2)+1;
                        switch(JailedLV)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,3);
                        SetPlayerInterior(playerid,10);
                    }
                    case 4:
                    {
                        new adminjailed = random(2)+1;
                        switch(adminjailed)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                    }
            }
    }
    TogglePlayerControllable(playerid,1);
    SetPlayerSkin(playerid, 42);
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    return true;

 

 

 

Спойлер

public OnPlayerDeath(playerid, killerid, reason)

if (pData[playerid][pJail])
    {
        switch (pData[playerid][pPrison])
            {
                    case 1:
                    {
                        new JailedLS = random(2)+1;
                        switch(JailedLS)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 1;
                    }
                    case 2:
                    {
                        new JailedSF = random(2)+1;
                        switch(JailedSF)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,2);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 2;
                    }
                    case 3:
                    {
                        new JailedLV = random(2)+1;
                        switch(JailedLV)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,3);
                        SetPlayerInterior(playerid,10);
                        pData[playerid][pPrison] = 3;
                    }
                    case 4:
                    {
                        new adminjailed = random(2)+1;
                        switch(adminjailed)
                        {
                            case 1: SetPlayerPos(playerid,6.5445,29.4482,-67.8428),SetPlayerFacingAngle(playerid,81.6021);
                            case 2: SetPlayerPos(playerid,5.7334,33.9168,-67.8428),SetPlayerFacingAngle(playerid,2.1597);
                        }
                        SetPlayerVirtualWorld(playerid,1);
                        SetPlayerInterior(playerid,10);
                    }
            }
    }

    ResetPlayerWeapons(playerid);
    TogglePlayerControllable(playerid,1);
    SetPlayerSkin(playerid, 42);
    if(pData[playerid][pFraction]) SetPlayerColor(playerid,gFractionColor[pData[playerid][pFraction] - 1]);
    UpdatePlayerData(playerid,"wanted",pData[playerid][pWanted]);
    UpdatePlayerData(playerid,"jail",pData[playerid][pJail]);
    UpdatePlayerData(playerid,"prison",pData[playerid][pPrison]);

    SetPlayerWantedLevel(playerid,0);
    return 1;

 

 

Edited by amazonite

Share this post


Link to post
  • 0

Share this post


Link to post
  • 0

Спасибо огромноееее. Всё получилось :)))))))))) дальше разбирались в ВК. Вы ЛУЧШИЙ ПРОСТО. С меня +

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0