Ronis Posted June 6, 2016 Share 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 ) Link to comment
roaddog Posted June 6, 2016 Share 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 Link to comment
Ronis Posted June 7, 2016 Author Share 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 Link to comment
ViRuZGamiing Posted June 7, 2016 Share Posted June 7, 2016 if (getPedOccupiedVehicleSeat(getLocalPlayer()) == 0) then instead of local occupants = getVehicleOccupants(theVehicle) if occupants[0]==getLocalPlayer() then 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