Vehicle 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: Vehicle lights (
/showthread.php?tid=307969)
Vehicle lights -
TheLoolyWiz - 01.01.2012
Hey guys, what's the function for turning on and off the lights?
I want to do this:
pawn Код:
if(IsKeyJustDown(KEY_NO, newkeys, oldkeys))
{
/* Function */
}
And how do I control Direction Indicator Lights?
Thanks a lot
Re: Vehicle lights -
Face9000 - 01.01.2012
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Re: Vehicle lights -
TheLoolyWiz - 01.01.2012
Thanks

But how do I use Direction indicator lights?
Re: Vehicle lights -
Face9000 - 01.01.2012
What you mean for Direction Indicator Lights?
Re: Vehicle lights -
TheLoolyWiz - 01.01.2012

When you want to change direction..
Re: Vehicle lights -
Face9000 - 01.01.2012
I think it's not possible.
Re: Vehicle lights -
Voldemort - 01.01.2012
Make a timer which damage and fix car wings

and I love your preview pic
use
UpdateVehicleDamageStatus
Re: Vehicle lights -
N0FeaR - 01.01.2012
try this
Код:
if(IsKeyJustDown(KEY_NO, newkeys, oldkeys))
{
new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
SetVehicleLights(vehicleid, playerid);
}
Код:
SetVehicleLights(vehicleid, playerid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(lights == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle lights successfully turned off.");
}
else if(lights == VEHICLE_PARAMS_OFF || lights == VEHICLE_PARAMS_UNSET)
{
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle lights successfully turned on.");
}
return 1;
}