DzMG-LV Posted March 18, 2016 Share Posted March 18, 2016 So i made script when vehicle have headlight states 1-Tilting down 2-Tilting up 3-Off It switches from 1 to 2, but i can't switch them off (to 3) function toggleLights(source, key, keystate) local veh = getPedOccupiedVehicle(source) local inVehicle = getElementData(source, "realinvehicle") if (veh) and (inVehicle==1) then local model = getElementModel(veh) if not (lightlessVehicle[model]) then local lights = getVehicleOverrideLights(veh) local seat = getPedOccupiedVehicleSeat(source) if (seat==0) then if (lights~=3) then setVehicleOverrideLights(veh, 2) exports['anticheat-system']:changeProtectedElementDataEx(veh, "lights", 2, true) if (lights~=2) then setVehicleOverrideLights(veh, 2) exports['anticheat-system']:changeProtectedElementDataEx(veh, "lights", 1, true) if (lights~=1) then setVehicleOverrideLights(veh, 1) exports['anticheat-system']:changeProtectedElementDataEx(veh, "lights", 0, true) end end end end end end end addCommandHandler("lights", toggleLights, true) addEvent('togLightsVehicle', true) addEventHandler('togLightsVehicle', root, function() toggleLights(client) end) Link to comment
DzMG-LV Posted March 19, 2016 Author Share Posted March 19, 2016 I can switch from Tilting down to tilting up, but i can't switch them off. thats my problem Tilting Down: Tilting Up: It needs work like this. First when u press L u have TIlting Down state, when u press again L u have Tilting Up state but when u press third time ur lights switches off, but i cant switch them off. Link to comment
DzMG-LV Posted March 21, 2016 Author Share Posted March 21, 2016 [quote name=..&G:..] Its not leaked, i used Dynamic_Lighting and Dynamic_Lighting_Vehicles. Link to comment
..:D&G:.. Posted March 21, 2016 Share Posted March 21, 2016 exports['anticheat-system']:changeProtectedElementDataEx(veh, "lights", 0, true) Seems like a Valhalla roleplay script Link to comment
DzMG-LV Posted March 22, 2016 Author Share Posted March 22, 2016 [quote name=..&G:..] exports['anticheat-system']:changeProtectedElementDataEx(veh, "lights", 0, true) Seems like a Valhalla roleplay script And? Why i can't add new features to it? +its my local server not public. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now