SA-MP Forums Archive
Fully Controlable lights? - 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: Fully Controlable lights? (/showthread.php?tid=643750)



Fully Controlable lights? - maksicnm - 26.10.2017

I cannot make lights ON when it's daytime..
When is night it works with KEY_YES or CMD anyway, i make all right, but what i need to do ongamemodeinit?


Re: Fully Controlable lights? - Escobabe - 26.10.2017

OnGameModeInit:
PHP код:
ManualVehicleEngineAndLights(); 
On command or somewhere:
PHP код:
new vehicle GetPlayerVehicleID(playerid);
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
if(
lights == 1)
        {
        
SetVehicleParamsEx(vehicle,engine,0,alarm,doors,bonnet,boot,objective);
        
SendClientMessage(playerid,-1,"You've turned on the lights!");
        }
        else
        {
        
SetVehicleParamsEx(vehicle,engine,1,alarm,doors,bonnet,boot,objective);
        
SendClientMessage(playerid,-1,"You've turned off the lights!");
           }