SA-MP Forums Archive
OnPlayerKeyStateChange bug - 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: OnPlayerKeyStateChange bug (/showthread.php?tid=618669)



OnPlayerKeyStateChange bug - danielpalade - 08.10.2016

Код:
	if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new vehicle = GetPlayerVehicleID(playerid);
		GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
		if(lights == 0)
		{
			SetVehicleParamsEx(vehicle, engine, 1, alarm, doors, bonnet, boot, objective);
		}		
		else if(lights == 1)
		{
			SetVehicleParamsEx(vehicle, engine, 0, alarm, doors, bonnet, boot, objective);
		}
	}
This piece of code should turn the vehicle lights on when pressing the CTRL key.
For some reason, nothing happens when I press CTRL.
Why is that so?


Re: OnPlayerKeyStateChange bug - Luicy. - 08.10.2016

Press ALT gr https://sampwiki.blast.hk/wiki/Keys
--
btw;
change it to;
PHP код:
SetVehicleParamsEx(vehicleengine, !lightsalarmdoorsbonnetbootobjective); 



Re: OnPlayerKeyStateChange bug - danielpalade - 08.10.2016

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
Press ALT gr https://sampwiki.blast.hk/wiki/Keys
--
btw;
change it to;
PHP код:
SetVehicleParamsEx(vehicleengine, !lightsalarmdoorsbonnetbootobjective); 
But LCTRL should be working too, but it ain't.