Arrest command problems
#7

Sorry for late reply i was eating in a resturant

here is the full command

pawn Код:
CMD:ar(playerid,params[])
{
    new id, string[128], pwl = GetPlayerWantedLevel(id);
    if(GetPlayerTeam(playerid) != Cops)
    {
        SendClientMessage(playerid, COLOR_RED,"Only law enforcement can arrest wanted suspects.");
        return 1;
    }
    if(!IsPlayerConnected(id))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot arrest them.",id);
        SendClientMessage(playerid, COLOR_RED,string);
        return 1;
    }
    if(Jailed[id] == 1)
    {
       SendClientMessage(playerid, COLOR_RED, "You cannot arrest players that are already jailed.");
       return 1;
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_RED,"You cannot arrest a suspect while in a vehicle. Exit the vehicle first.");
        return 1;
    }
    if(GetPlayerState(id) == PLAYER_STATE_DRIVER || GetPlayerState(id) == PLAYER_STATE_PASSENGER)
    {
        SendClientMessage(playerid,COLOR_RED,"You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
        return 1;
    }
        if(Civilian[id] == 1)
        {
           if(Cuffed[id] == 1)
           {
              if(PlayerToPlayer(playerid, id, 2.0))
              {
                  if(pwl >= 4)
                  {
                      GivePlayerMoney(playerid, 3000);
                      IncreaseScore(playerid, 1);
                      IncreaseCoprank(playerid, 1);
                      Jailed[id] = 1;
                      JailTime[id] = 60;
                      Cuffed[id] = 0;
                      SetPlayerInterior(id, 6);
                      SetPlayerPos(id, 264.29999, 77.4, 1001);
                      SendClientMessage(id, COLOR_LIGHTBLUE, "**LOS SANTOS PRISON**");
                      SendClientMessage(id, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison, you will be out of prison in 60 seconds");
                      SetPlayerWantedLevel(id, 0);
                      SetPlayerHealth(id,99999);
                      SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
                      ResetPlayerWeapons(id);
                      format(string,sizeof(string),"Police Officer %s(%d) Has arrested wanted suspect %s(%d) and was given $3000 for arresting him.",GetName(playerid),playerid,GetName(id),id);
                      SendClientMessageToAll(COLOR_ORANGE,string);
                      return 1;
                  }
              }  
           }
        }  
    return 1;
}
Reply


Messages In This Thread
Arrest command problems - by DarkLored - 16.03.2014, 00:20
Re: Arrest command problems - by Zeppo - 16.03.2014, 00:24
AW: Arrest command problems - by Macronix - 16.03.2014, 00:24
Re: Arrest command problems - by CuervO - 16.03.2014, 00:28
Re: Arrest command problems - by DarkLored - 16.03.2014, 00:38
AW: Arrest command problems - by Macronix - 16.03.2014, 00:47
Re: Arrest command problems - by DarkLored - 16.03.2014, 01:50
Re: Arrest command problems - by CuervO - 16.03.2014, 02:30
Re: Arrest command problems - by DarkLored - 16.03.2014, 02:59
Re: Arrest command problems - by CuervO - 16.03.2014, 03:03

Forum Jump:


Users browsing this thread: 5 Guest(s)