-.Paradox.- Posted September 19, 2013 Share Posted September 19, 2013 Hello, I need some functions to create a script like example if player hit another player with vehicle he instantly die like real life :3 thanks for helping Link to comment
arezu Posted September 19, 2013 Share Posted September 19, 2013 You can use onClientVehicleCollision event Link to comment
kevenvz Posted September 20, 2013 Share Posted September 20, 2013 Maybe add a velocity check? Else it will be like you drive 2 mph and you hit a vehicle and you die. Link to comment
-.Paradox.- Posted September 20, 2013 Author Share Posted September 20, 2013 If the player is in vehicle and he hit another player in foot he die instantly that what I'm trying to make Link to comment
kevenvz Posted September 20, 2013 Share Posted September 20, 2013 onPlayerContact http://development.mtasa.com/index.php? ... yerContact Link to comment
-.Paradox.- Posted September 20, 2013 Author Share Posted September 20, 2013 Won't help Link to comment
Driggero Posted September 20, 2013 Share Posted September 20, 2013 (edited) addEventHandler("onClientVehicleCollision", getRootElement(), function(hitElement) if getElementType(hitElement)=="ped" then theKiller = getVehicleController(source) setElementHealth(theKiller, 0) end end ) Something like that perhaps? Edited September 20, 2013 by Guest Link to comment
Driggero Posted September 20, 2013 Share Posted September 20, 2013 OH, you want the ped's health to be set to 0? That makes more sense in that case: addEventHandler("onClientVehicleCollision", getRootElement(), function(hitElement) if getElementType(hitElement)=="ped" then setElementHealth(hitElement, 0) end end ) 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