/ar Command
#1

Can someone help me with the ar command for some reason i get jailled but
i am not getting realesed from it and it dosent show me the timer
i will post the code tell me what i just need to add and i am trying to make the command for Cops and Robbers

pawn Код:
CMD:ar(playerid,params[])
{
    new targetid;
    new string[128];
    if(sscanf(params, "u", targetid))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /ar (Player Name/ID)");
        return 1;
    }
    if(gTeam[playerid] != Team_Cop)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can arrest wanted suspects.");
        return 1;
    }
    if(!IsPlayerConnected(targetid))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot arrest them.",targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,targetid) > 4)
    {
        format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to arrest him.",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(GetPVarInt(targetid, "Cuffed") == 0)
    {
        format(string,sizeof(string),"%s(%d) is not cuffed. You have to place the suspect in cuffs before attempted to arrest them.",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect while in a vehicle. Exit the vehicle first.");
        return 1;
    }
    if(GetPlayerState(targetid) == PLAYER_STATE_DRIVER || GetPlayerState(targetid) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
        return 1;
    }
    if(playerid == targetid)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest yourself, why would you do that anyway?");
        return 1;
    }
    if(GetPlayerWantedLevel(targetid) < 3)
    {
        format(string,sizeof(string),"%s(%d)'s wanted level is too low. You cannot jail them. Use /ticket (Player ID).",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    new pwl = GetPlayerWantedLevel(targetid);
    if(pwl == 4)
    {
        GivePlayerMoney(playerid, 3000);
        IncreaseScore(playerid, 1);
        IncreaseCoprank(playerid, 1);
        SetPVarInt(targetid, "JailTime", 45);
        SetPlayerInterior(targetid, 10);
        new rnd = random(sizeof(PrisonSpawn));
        SetPlayerPos(targetid, 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(targetid, 1);
        SetPlayerWantedLevel(targetid, 0);
        return 1;
    }
    return 1;
}
Reply
#2

Re play for this quickly please +1REP for helper
Reply
#3

Just use this, It's better than yours!
pawn Код:
CMD:arrest(playerid, params[])
{
    if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pFaction] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pFaction] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pFaction] == 12 && PlayerInfo[playerid][pDivision] == 2))
    {
        if(!IsAtArrestPoint(playerid))
        {
            SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the arrest point.");
            return 1;
        }

        new string[128], moneys, time, bail, bailprice;
        if(sscanf(params, "dddd", moneys, time, bail, bailprice)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");

        if(moneys < 1 || moneys > 30000) { SendClientMessageEx(playerid, COLOR_GREY, "The jail price can't be below $1 or above $30,000."); return 1; }
        if(time < 1 || time > 30) { SendClientMessageEx(playerid, COLOR_GREY, "Jail time can't be below 1 or above 30 minutes - take the person to prison for more time."); return 1; }
        if(bail < 0 || bail > 1) { SendClientMessageEx(playerid, COLOR_GREY, "The bail option must be set to 0 or 1."); return 1; }
        if(bailprice < 0 || bailprice > 10000) { SendClientMessageEx(playerid, COLOR_GREY, "The bail price can't be below $0 or above $10,000."); return 1; }
        new suspect = GetClosestPlayer(playerid);
        if(IsPlayerConnected(suspect))
        {
            if(ProxDetectorS(5.0, playerid,suspect))
            {
                if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pFaction] != 12)
                {
                    SendClientMessageEx(playerid, COLOR_GREY, "The player must have a wanted level of at least one star.");
                    return 1;
                }
                new giveplayerid;
                format(string, sizeof(string), "* You arrested %s!", GetPlayerNameEx(suspect));
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                GivePlayerCash(suspect, -moneys);
                Tax += moneys;
                ResetPlayerWeaponsEx(suspect);
                SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                RemovePlayerAttachedObject(giveplayerid,0);
                if(PlayerVehicleInfo[suspect][0][pvTicket] != 0)
                {
                    PlayerVehicleInfo[suspect][0][pvTicket] = 0;
                }
                if(PlayerVehicleInfo[suspect][1][pvTicket] != 0)
                {
                    PlayerVehicleInfo[suspect][1][pvTicket] = 0;
                }
                if(PlayerVehicleInfo[suspect][2][pvTicket] != 0)
                {
                    PlayerVehicleInfo[suspect][2][pvTicket] = 0;
                }
                if(PlayerVehicleInfo[suspect][3][pvTicket] != 0)
                {
                    PlayerVehicleInfo[suspect][3][pvTicket] = 0;
                }
                if(PlayerVehicleInfo[suspect][4][pvTicket] != 0)
                {
                    PlayerVehicleInfo[suspect][4][pvTicket] = 0;
                }
                //TogglePlayerControllable(suspect, 1);
                if(IsPlayerInRangeOfPoint(playerid, 4.0, -800.397094, -1877.925903, 11.668975) || IsPlayerInRangeOfPoint(playerid, 3.0,1528.4888,-1677.7632,5.8906) || IsPlayerInRangeOfPoint(playerid, 3.0,1566.4901,-1653.9076,28.3956) || IsPlayerInRangeOfPoint(playerid,4.0,680.2208,-1546.9856,14.8516) || PlayerInfo[playerid][pVW] == 133337)
                {
                    //format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", GetPlayerNameEx(playerid), GetPlayerNameEx(suspect));
                    //OOCNews(COLOR_LIGHTRED, string);
                    SetPlayerInterior(suspect, 10);
                    new rand = random(sizeof(LSPDJail));
                    SetPlayerFacingAngle(suspect, 0);
                    SetPlayerPos(suspect, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 1;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 133337;
                    SetPlayerVirtualWorld(suspect, 133337);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                }
                else if(PlayerInfo[playerid][pFaction] == 11) {

                    SetPlayerInterior(suspect, 1);
                    PlayerInfo[suspect][pInt] = 1;
                    SetPlayerVirtualWorld(suspect, 0);
                    PlayerInfo[suspect][pVW] = 0;

                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }

                    PlayerInfo[suspect][pJailed] = 2;
                    PhoneOnline[suspect] = 1;
                    DeletePVar(suspect, "IsFrozen");
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;

                    new rand = random(sizeof(ICPrisonSpawns));
                    Streamer_UpdateEx(suspect, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
                    SetPlayerPos(suspect, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
                    Player_StreamPrep(suspect, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2], FREEZE_TIME);
                    ResetPlayerWeaponsEx(suspect);

                }
                else if(PlayerInfo[playerid][pFaction]==2||PlayerInfo[playerid][pLeader]==2)
                {

                    SetPlayerInterior(suspect, 1);
                    PlayerInfo[suspect][pVW] = 1324123;
                    PlayerInfo[suspect][pInt] = 1;
                    SetPlayerVirtualWorld(suspect, 1324123);
                    SetPlayerPos(suspect,315.1677,-1451.5564,-33.5292);
                    Player_StreamPrep(suspect, 315.1677,-1451.5564,-33.5292, FREEZE_TIME);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    PlayerInfo[suspect][pJailed] = 3;
                    PhoneOnline[suspect] = 1;
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);

                }
                else if(PlayerInfo[playerid][pFaction]==3||PlayerInfo[playerid][pLeader]==3)
                {
                    //format(string, sizeof(string), "<< Deputy %s arrested suspect %s >>", sendername, giveplayer);
                    //OOCNews(COLOR_LIGHTRED, string);
                    SetPlayerInterior(suspect, 3);
                    SetPlayerPos(suspect,198.1944,175.9581,1003.0234);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 8;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 0;
                    SetPlayerVirtualWorld(suspect, 0);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                }
                else if(PlayerInfo[playerid][pFaction]==7||PlayerInfo[playerid][pLeader]==7)
                {
                    SetPlayerPos(suspect,2500.3296,-1679.2875,562.7988);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 7;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 1699;
                    SetPlayerVirtualWorld(suspect, 1699);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                    Player_StreamPrep(suspect,2500.3296,-1679.2875,562.7988, FREEZE_TIME);
                }
                else if(PlayerInfo[playerid][pFaction]==12||PlayerInfo[playerid][pLeader]==12)
                {
                    TogglePlayerControllable(suspect, 0);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 9;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    SetPlayerInterior(suspect, 5);
                    PlayerInfo[suspect][pInt] = 5;
                    PlayerInfo[suspect][pVW] = 99;
                    SetPlayerVirtualWorld(suspect, 99);
                    SetPlayerPos(suspect, 319.554931, 312.155181, 999.148437);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                }
                else if(PlayerInfo[playerid][pFaction]==1||PlayerInfo[playerid][pLeader]==1)
                {
                    new rand = random(sizeof(LSPDJail));
                    SetPlayerPos(suspect, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 1;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 133337;
                    SetPlayerVirtualWorld(suspect, 133337);
                    SetPlayerInterior(suspect, 10);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                    Player_StreamPrep(suspect,LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2], FREEZE_TIME);
                }
                else if(PlayerInfo[playerid][pFaction]==14||PlayerInfo[playerid][pLeader]==14)
                {
                    new rand = random(sizeof(INTERPOLJail));
                    SetPlayerPos(suspect, INTERPOLJail[rand][0], INTERPOLJail[rand][1], INTERPOLJail[rand][2]);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    DeletePVar(suspect, "IsFrozen");
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 1;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    DeletePVar(suspect, "PlayerCuffed");
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 133337;
                    SetPlayerVirtualWorld(suspect, 133337);
                    SetPlayerInterior(suspect, 10);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                    Player_StreamPrep(suspect,INTERPOLJail[rand][0], INTERPOLJail[rand][1], INTERPOLJail[rand][2], FREEZE_TIME);
                }
                else if(IsPlayerInRangeOfPoint(playerid, 3.0,611.96, -587.25, 17.22))
                {
                    //format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
                    //OOCNews(COLOR_LIGHTRED, string);
                    SetPlayerInterior(suspect, 5);
                    SetPlayerPos(suspect,319.17, 312.13, 999.14);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    SetPVarInt(suspect, "IsFrozen", 0);
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 5;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    SetPVarInt(suspect, "PlayerCuffed", 0);
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 0;
                    SetPlayerVirtualWorld(suspect, 0);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                }
                else if(IsPlayerInRangeOfPoint(playerid, 3.0,2334.65, 566.84, 7.78) || IsPlayerInRangeOfPoint(playerid, 3.0,2182.20, 530.32, 1.19))
                {
                    //format(string, sizeof(string), "<< Coast Guardsman %s arrested suspect %s >>", sendername, giveplayer);
                    //OOCNews(COLOR_LIGHTRED, string);
                    SetPlayerInterior(suspect, 5);
                    SetPlayerPos(suspect,319.17, 312.13, 999.14);
                    if(PlayerInfo[suspect][pDonateRank] >= 2)
                    {
                        PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
                    }
                    else
                    {
                        PlayerInfo[suspect][pJailTime] = time * 60;
                    }
                    SetPVarInt(suspect, "IsFrozen", 0);
                    //Frozen[suspect] = 0;
                    PlayerInfo[suspect][pJailed] = 5;
                    PhoneOnline[suspect] = 1;
                    PlayerInfo[suspect][pArrested] += 1;
                    SetPlayerFree(suspect,playerid, "was arrested");
                    WantedPoints[suspect] = 0;
                    PlayerInfo[suspect][pWantedLevel] = 0;
                    SetPlayerToTeamColor(suspect);
                    SetPlayerWantedLevel(suspect, 0);
                    WantLawyer[suspect] = 1;
                    TogglePlayerControllable(suspect, 1);
                    ClearAnimations(suspect);
                    PlayerCuffed[suspect] = 0;
                    SetPVarInt(suspect, "PlayerCuffed", 0);
                    PlayerCuffedTime[suspect] = 0;
                    PlayerInfo[suspect][pVW] = 0;
                    SetPlayerVirtualWorld(suspect, 0);
                    SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(giveplayerid,0);
                }
                if(bail == 1)
                {
                    JailPrice[suspect] = bailprice;
                    format(string, sizeof(string), "You are jailed for %d minutes.   Bail: $%d", PlayerInfo[suspect][pJailTime]/60, JailPrice[suspect]);
                    SendClientMessageEx(suspect, COLOR_LIGHTBLUE, string);
                }
                else
                {
                    JailPrice[suspect] = 0;
                    format(string, sizeof(string), "You are jailed for %d minutes.   Bail: Unable", PlayerInfo[suspect][pJailTime]/60);
                    SendClientMessageEx(suspect, COLOR_LIGHTBLUE, string);
                }
            }//distance
        }//not connected
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "   No-one close enough to arrest.");
            return 1;
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "  You are not a Cop / S.H.A.F.T. / FBI / Coastguard!");
        return 1;
    }
    return 1;
}
Reply
#4

Actually asked a command for cops and robbers
Not rp can someone help me with this please
Reply
#5

Please someone I wont ask anymore if you help me
Please
Reply
#6

pawn Код:
@Release(playerid);
@Release(playerid)
{
    new Time = GetPVarInt(playerid, "JailTime");
    if(!IsPlayerConnected(playerid))
        return 0;

    if(Time < 1)
        return SpawnPlayer(playerid);

    new str[30];
    format(str, sizeof(str), "You will be released in: %d", Time);
    GameTextForPlayer(playerid, str, 2500, 3); // Change it if you want

    SetPVarInt(playerid, "JailTime", Time - 1); // Decrease the player's jail time
    SetTimerEx("@Release", 1000, false, "i", playerid);
    return 1;
}

CMD:ar(playerid,params[])
{
    new
        targetid;

    if(gTeam[playerid] != Team_Cop)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can arrest wanted suspects.");
        return 1;
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect while in a vehicle. Exit the vehicle first.");
        return 1;
    }

    if(sscanf(params, "u", targetid))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /ar (Player Name/ID)");
        return 1;
    }
    new
        string[128];

    if(targetid == INVALID_PLAYER_ID || !IsPlayerConnected(targetid))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot arrest them.",targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(playerid == targetid)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest yourself, why would you do that anyway?");
        return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,targetid) > 4)
    {
        format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to arrest him.",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(GetPlayerState(targetid) == PLAYER_STATE_DRIVER || GetPlayerState(targetid) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
        return 1;
    }
    if(GetPlayerWantedLevel(targetid) < 3)
    {
        format(string,sizeof(string),"%s(%d)'s wanted level is too low. You cannot jail them. Use /ticket (Player ID).",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(GetPVarInt(targetid, "Cuffed") == 0)
    {
        format(string,sizeof(string),"%s(%d) is not cuffed. You have to place the suspect in cuffs before attempted to arrest them.",GetName(targetid),targetid);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    GivePlayerMoney(playerid, 3000);
    IncreaseScore(playerid, 1);
    IncreaseCoprank(playerid, 1);
    SetPVarInt(targetid, "JailTime", 45);
    SetPlayerInterior(targetid, 10);
    new rnd = random(sizeof(PrisonSpawn));
    SetPlayerPos(targetid, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
    SendClientMessage(targetid, COLOR_GREY, "**LOS SANTOS PRISON**");
    SendClientMessage(targetid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
    TogglePlayerControllable(targetid, 1);
    SetPlayerWantedLevel(targetid, 0);
    @Release(targetid);
    return 1;
}
Reply
#7

Thanks alot can you just tell me how to make the player spawn outside lspd after being released
Reply
#8

why dont u use this ? Clicky
Reply
#9

Quote:
Originally Posted by efrim123
Посмотреть сообщение
Thanks alot can you just tell me how to make the player spawn outside lspd after being released
Add this: SetPlayerPos(playerid, 1529.6, -1691.2, 13.3);
Reply
#10

Where do i need to add that
?
it will spawn me outside lspd??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)