myonlake Posted July 7, 2011 Posted July 7, 2011 (edited) Hello, I was wondering what is that function that makes (for example) LSPD show blue area on map? Like a turf wars in the Single Player. Is it something to do with the dX drawing? Edited May 30, 2019 by myonlake
Castillo Posted July 7, 2011 Posted July 7, 2011 No, they are radar areas, read about them here: https://wiki.multitheftauto.com/wiki/Ser ... _functions
myonlake Posted July 7, 2011 Author Posted July 7, 2011 Thank you mate. I would ask another thing here too. What's problem with this one? This is an emergency light script, it doesn't quit emergency lights if I do the /l command again. In debugscript it says: .lua:9: Bad argument @ 'killTimer' .lua:10: Bad argument @ 'killTimer' function EmergencyLights ( source ) theVehicle = getPlayerOccupiedVehicle ( source ) if ( theVehicle ) then if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then setVehicleOverrideLights ( theVehicle, 2 ) setTimer ( setLight, 400, 1 ) else setVehicleOverrideLights ( theVehicle, 0 ) killTimer ( setLight ) killTimer ( setLight2 ) end end end function setLight ( ) setTimer ( setLight2, 400, 1 ) setVehicleHeadLightColor (theVehicle, 000, 000, 255) end function setLight2 ( ) setVehicleHeadLightColor (theVehicle, 255, 000, 000) setTimer ( setLight, 400, 1 ) end addCommandHandler ( "l", EmergencyLights )
Castillo Posted July 7, 2011 Posted July 7, 2011 Try this: setLights = {} function EmergencyLights ( thePlayer ) theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( theVehicle ) then if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then setVehicleOverrideLights ( theVehicle, 2 ) setLights[theVehicle] = setTimer ( setLight, 400, 1, 1, theVehicle ) else setVehicleOverrideLights ( theVehicle, 0 ) setVehicleHeadLightColor(theVehicle, 255, 255, 255) if isTimer(setLights[theVehicle]) then killTimer ( setLights[theVehicle] ) end end end end addCommandHandler ( "l", EmergencyLights ) function setLight ( state, theVehicle ) if state == 1 then setLights[theVehicle] = setTimer ( setLight, 400, 1, 2, theVehicle ) setVehicleHeadLightColor (theVehicle, 000, 000, 255) elseif state == 2 then setVehicleHeadLightColor (theVehicle, 255, 000, 000) setLights[theVehicle] = setTimer ( setLight, 400, 1, 1, theVehicle ) end end
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