arrestKey in car
#4

There are some keys that you can use in cars. One is KEY_CHROUCH which is the Horn Key (H or Caps Lock).
Also, KEY_ACTION, KEY_FIRE, KEY_SPRINT (etc.) i find KEY_CHROUCH as the finest one.

Код:
if(newkeys == KEY_CHROUCH)
{
     new ID = GetClosestPlayerToPlayer(playerid);
     dcmd_arrestkey(playerid, IntToStr(GetClosestPlayerToPlayer(playerid)));
     dcmd_ticketkey(playerid, IntToStr(GetClosestPlayerToPlayer(playerid)));
     if(GetPlayerWantedLevel(ID)==0 && GetDistanceBetweenPlayers(playerid,ID) > 4)
     {
          SendClientMessage(playerid,COLOR_RED,"No Suspect In Range!");
     }
     return 1;
}
The KEY_CHROUCH is also "C" so, to don`t allow cops using this thing while on foot, you can add something like:
Код:
if(IsPlayerInVehicle(playerid, the id of the car))
{
your script
}
PS: Also, don`t forgot to add a check if the player is a cop. Because i can`t see that in your script.
Reply


Messages In This Thread
arrestKey in car - by Admigo - 12.05.2011, 15:32
Re: arrestKey in car - by SkizzoTrick - 12.05.2011, 15:47
Re: arrestKey in car - by Admigo - 12.05.2011, 18:34
Re: arrestKey in car - by Westiee - 12.05.2011, 21:30
Re: arrestKey in car - by Admigo - 12.05.2011, 21:43
Re: arrestKey in car - by Admigo - 12.05.2011, 21:57

Forum Jump:


Users browsing this thread: 2 Guest(s)