onplayerkeystatechange
#1

Heey all,
I want to make if a player press 2 in car they can arrest players and it work if a player dont drive,so they dont give gas and then they can arrest a player.
But how can i make if a player drive he can arrest a player?
Code:
Code:
if (newkeys == KEY_SUBMISSION && GetPlayerState(playerid)==PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
 	{
		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;
	}
Thanks admigo
Reply


Messages In This Thread
onplayerkeystatechange - by Admigo - 30.10.2011, 10:38
Re: onplayerkeystatechange - by =WoR=Varth - 30.10.2011, 11:08
Re: onplayerkeystatechange - by Admigo - 30.10.2011, 15:46
Re: onplayerkeystatechange - by =WoR=Varth - 30.10.2011, 15:55
Re: onplayerkeystatechange - by Admigo - 30.10.2011, 16:06
Re: onplayerkeystatechange - by rayan khan - 13.09.2012, 11:31

Forum Jump:


Users browsing this thread: 1 Guest(s)