Light Vehicle Error
#1

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
Reply
#2

help me pls
Reply
#3

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

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;
}

Reply
#5

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

ya -_- so tired to try dat
Reply
#7

Under OnGameModeInit add

ManualVehicleEngineAndLights();


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


Forum Jump:


Users browsing this thread: 3 Guest(s)