PDA

View Full Version : How to make the light of vehicles work on daytime?


Fenky
06/08/2013, 02:45 PM
As the title says?

Konstantinos
06/08/2013, 03:05 PM
http://wiki.sa-mp.com/wiki/ManualVehicleEngineAndLights

Fenky
06/08/2013, 03:18 PM
Thanks!

Fenky
06/08/2013, 03:45 PM
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..

Konstantinos
06/08/2013, 03:57 PM
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)

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!