SA-MP Forums Archive
Light Vehicle Error - 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: Light Vehicle Error (/showthread.php?tid=541089)



Light Vehicle Error - ScorpiusMalfoy - 09.10.2014

My vehicle system got a problem, i turn on light in day time this vehicle still off, if night time light vehicle still on. Anyone can help me fix for using car light anytime pls ! Thanks you


Re: Light Vehicle Error - ScorpiusMalfoy - 09.10.2014

help me pls


Re: Light Vehicle Error - YanLanger - 09.10.2014

First of all don't bump after 1 minute second of all show code.


Re: Light Vehicle Error - ScorpiusMalfoy - 09.10.2014

I got ManualVehicleEngineAndLights(); in gamemodeinit and this is my command and funtion im using for turn on off vehicle engine or light.

Quote:

CMD:car(playerid, params[])
{
if(isnull(params))
{
SendClientMessageEx(playerid, COLOR_GREY, "USE: /car [name]");
return 1;
}
if(strcmp(params, "light", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"Can't not use on vehicle.");
SetVehicleLights(vehicleid, playerid);
}
}

stock 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, "Light Vehicle Has been {E80C34}Off{FFFFFF}.");
}
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, "Light Vehicle Has been {04DB48}On{FFFFFF}.");
}
return 1;
}




Re: Light Vehicle Error - YanLanger - 09.10.2014

1. use [code] or [pawn]
2.Hmmm I don't see anything wrong here. lemme read it again.


Re: Light Vehicle Error - ScorpiusMalfoy - 09.10.2014

ya -_- so tired to try dat


Re: Light Vehicle Error - ikey07 - 09.10.2014

Under OnGameModeInit add

ManualVehicleEngineAndLights();


you will need to make some engine turning on system aswell.