SA-MP Forums Archive
How? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How? (/showthread.php?tid=364969)



How? - Vizi - 01.08.2012

Hi!!
How to make command to do with a number like "2"
Exemple to turn on the engine with "2" ??


Re: How? - Glint - 01.08.2012

You can use OnPlayerKeyStateChange for a list of Keys view This.


Re: How? - Jikesh - 01.08.2012

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

 if(newkeys == KEY_FIRE) //Starting vehicle engine
 {
     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
     {

		new engine,lights,alarm,doors,bonnet,boot,objective;
		new vid = GetPlayerVehicleID(playerid);
		GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
     }
     return 1;
 }

return 1;
}
You can replace the keys from https://sampwiki.blast.hk/wiki/GetPlayerKeys