SA-MP Forums Archive
How to make the light of vehicles work on daytime? - 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 to make the light of vehicles work on daytime? (/showthread.php?tid=456565)



How to make the light of vehicles work on daytime? - Fenky - 06.08.2013

As the title says?


Re: How to make the light of vehicles work on daytime? - Konstantinos - 06.08.2013

https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights


Re: How to make the light of vehicles work on daytime? - Fenky - 06.08.2013

Thanks!


Re: How to make the light of vehicles work on daytime? - Fenky - 06.08.2013

That nay not working as what I want.
In my server, when I /engine cars, the lights will be turned on automatic, but shines at nights only. I want to get it changed to the lights can be turned on and works on daytime..


Re: How to make the light of vehicles work on daytime? - Konstantinos - 06.08.2013

Quote:

Use this function before any player connects (OnGameModeInit) to tell all clients that the script will toggle the light and engine status by itself so that the vehicle doesn't start the engine when you enter it.

That function won't turn the lights on for you when you enter the vehicle. You need to code it like that.

By using this functions, lights are working to both day and night.

So, when you execute /engine command for the vehicle etc (don't forget to get the vehicleid, it is just an example)
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
// Turning the engine and lights on!