09.10.2014, 12:40
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
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; } |