Ronis Posted June 6, 2016 Posted June 6, 2016 Hello, so i have question, maybe i am wrong, but i thinking about this. IN CLIENT-SIDE triggerServerEvent("lspd:setSirenState", theVehicle, 1) For example if there is the 1 it's not working , how i can put the one over here? IN SERVER-SIDE function setSirenState() if exports.global:hasItem(source, 85) then -- sirens local curState = getElementData(source, "lspd:siren") exports.anticheat:changeProtectedElementDataEx(source, "lspd:siren", not curState) setVehicleSirensOn ( source , not curState ) end end addEvent( "lspd:setSirenState", true ) addEventHandler( "lspd:setSirenState", getRootElement(), setSirenState )
roaddog Posted June 6, 2016 Posted June 6, 2016 Server side function setSirenState(state) if state == 1 then --what to do if its 1 else --what to do if its not 1 end end You gone learn today. I work my ass off, but I still can't pay tho.
Ronis Posted June 7, 2016 Author Posted June 7, 2016 NOP not working, c-side function toggleSirens() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if (theVehicle) then local occupants = getVehicleOccupants(theVehicle) if occupants[0]==getLocalPlayer() then triggerServerEvent("lspd:setSirenState", theVehicle, 1) end end end
ViRuZGamiing Posted June 7, 2016 Posted June 7, 2016 if (getPedOccupiedVehicleSeat(getLocalPlayer()) == 0) then instead of local occupants = getVehicleOccupants(theVehicle) if occupants[0]==getLocalPlayer() then "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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