I saw someone asked for this!!
#1

I don't remeber exactly whoa sked for this but I know someone asked for an arresting command for a button so here it is:

pawn Код:
if(newkeys == KEY_LOOK_BEHIND)
    {
      if(gTeam[playerid] == TEAM_COPS)
      {
        new p1;
        new p2;
        GetDistanceBetweenPlayers(p1,p2);
        if(GetDistanceBetweenPlayers(p1,p2) > 5) return SendClientMessage(p1,COLOR_WHITE,"Nobody is close enough");
        if(GetDistanceBetweenPlayers(p1,p2) < 5)
        {
          GetPlayerWantedLevel(p2);
          if(GetPlayerWantedLevel(p2) == 0) return SendClientMessage(p1,COLOR_WHITE,"The player is not wanted");
          if(GetPlayerWantedLevel(p2) > 0)
          {
            TogglePlayerControllable(p2,0);
            SendClientMessageToAll(COLOR_GREEN,"Officer %s has arrested %s");
            GivePlayerMoney(p1,1000);
          }
        }
      }
      if(gTeam[playerid] == TEAM_ROBBERS || gTeam[playerid] == TEAM_MEDICS || gTeam == TEAM_FIREFIGHTERS) return SendClientMessage(playerid,COLOR_RED,"This command is only for a cop");
    }
There are no errors when compiling,of course you set your colors and Teams,but the only thing I forgot is how to define the "%s" when it says Officer %s has arrested %s I want copname,wantedname.
Reply


Messages In This Thread
I saw someone asked for this!! - by Cjgogo - 17.05.2011, 13:38
Re: I saw someone asked for this!! - by Seven_of_Nine - 17.05.2011, 13:43
Re: I saw someone asked for this!! - by Cjgogo - 17.05.2011, 13:45
Re: I saw someone asked for this!! - by Cjgogo - 17.05.2011, 13:49
Re: I saw someone asked for this!! - by xir - 17.05.2011, 13:54
Re: I saw someone asked for this!! - by Cjgogo - 17.05.2011, 14:06
Re: I saw someone asked for this!! - by Seven_of_Nine - 17.05.2011, 14:34

Forum Jump:


Users browsing this thread: 1 Guest(s)