carvalhosgamer Posted May 9, 2014 Share Posted May 9, 2014 hi, guys, i have tried all night long about this bug in my code... I need the player trouch the marker with car and brake immediately , that is my code: marker = createMarker(1219,-1812,13, "cylinder" , 4.0, 255, 255, 0, 170) blip = createBlipAttachedTo(marker, 55) addEventHandler("onClientMarkerHit",marker, action) function action() -- Action end the player's car touchs the marker and brake the car. please, i need you help!, some function in wiki, or example thats help me a lot thank you! Link to comment
TAPL Posted May 9, 2014 Share Posted May 9, 2014 Server Side: marker = createMarker(1219,-1812,13, "cylinder" , 4.0, 255, 255, 0, 170) blip = createBlipAttachedTo(marker, 55) addEventHandler("onMarkerHit", marker, function(hitElement) if getElementType(hitElement) == "vehicle" then blowVehicle(hitElement) end end) Link to comment
carvalhosgamer Posted May 9, 2014 Author Share Posted May 9, 2014 Great, thank you, its work like explosion, but i need stop the vehicle, like an bus on bus station, one marker and brake de velocity thank you very much for response Link to comment
TAPL Posted May 9, 2014 Share Posted May 9, 2014 You can set the velocity to zero, and freeze the vehicle or turn off the engine of the vehicle. setElementVelocity(hitElement, 0, 0, 0) setElementFrozen(hitElement, true) setVehicleEngineState(hitElement, false) Link to comment
carvalhosgamer Posted May 9, 2014 Author Share Posted May 9, 2014 You are awesome!!! Thank you very very Much, works perfectly! 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