PDA

View Full Version : Vehicle lights


TheLoolyWiz
01/01/2012, 08:00 PM
Hey guys, what's the function for turning on and off the lights?

I want to do this:

if(IsKeyJustDown(KEY_NO, newkeys, oldkeys))
{
/* Function */
}


And how do I control Direction Indicator Lights?

Thanks a lot 8)

Face9000
01/01/2012, 08:02 PM
http://wiki.sa-mp.com/wiki/SetVehicleParamsEx

TheLoolyWiz
01/01/2012, 08:05 PM
Thanks 8) But how do I use Direction indicator lights?

Face9000
01/01/2012, 09:15 PM
What you mean for Direction Indicator Lights?

TheLoolyWiz
01/01/2012, 09:35 PM
http://www.seriouswheels.com/pics-2009/bc/2009-BMW-Z4-Roadster-Headlights-with-LED-Direction-Indicator-Lights-1024x768.jpg When you want to change direction..

Face9000
01/01/2012, 09:37 PM
I think it's not possible.

Voldemort
01/01/2012, 10:08 PM
Make a timer which damage and fix car wings ;) and I love your preview pic:)

use UpdateVehicleDamageStatus

N0FeaR
01/01/2012, 10:14 PM
try this



if(IsKeyJustDown(KEY_NO, newkeys, oldkeys))
{
new engine,lights,alarm,doors,bonnet,boot,objective,ve hicleid;
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,d oors,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;
}