aim-killer Posted June 28, 2013 Posted June 28, 2013 I am trying to make a simple script that changes vehicle speed when the siren is turned on and when turned off to normal .. however i couldnt figure how to change the handling when the siren is turned on inside the vehicle without reEntering it here is the code below (server side): function siren (thePlayer) vehicle = getPedOccupiedVehicle(thePlayer) sirenon = getVehicleSirensOn (vehicle) if sirenon then setVehicleHandling ( vehicle, "engineAcceleration", 17 ) outputChatBox("on") else setVehicleHandling ( vehicle, "engineAcceleration", nil, false ) outputChatBox ("off") end end addEventHandler ( "onVehicleEnter",getRootElement(), siren )
AMARANT Posted June 28, 2013 Posted June 28, 2013 Add "onClientRender" event handler when you get in the vehicle and then check sirens. During getting out of a vehicle, remove the handler.
Castillo Posted June 28, 2013 Posted June 28, 2013 You could try binding the siren key to a function which will check the sirens state.
aim-killer Posted June 29, 2013 Author Posted June 29, 2013 EDIT: alright! thanks Castillo and amarant now i have got it to work with bindKey and a little help of setTimer
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