niemi Posted February 27, 2009 Posted February 27, 2009 I need help with vehicle godmode, I found an example from the forums that makes player godmode: function damag(attacker, weapon, bodypart) cancelEvent() end addEventHandler("onClientPlayerDamage", getLocalPlayer(), damag) But i can't make it work for vehicles, I tried this: function damag(attacker, weapon) cancelEvent() end addEventHandler("onVehicleDamage", getRootElement(), damag) It doesn't work. I'm just beginning lua scripting, but i can't get that work.
50p Posted February 27, 2009 Posted February 27, 2009 http://development.mtasa.com/index.php? ... amageProof
Lordy Posted February 27, 2009 Posted February 27, 2009 And to explain why your code doesnt work is that canceling the vehicle damage has to be done server side, as onVehicleDamage is a server side event (and canceling it wouldn't make sense client side anyway.) You can use your code server side or use the function 50p linked to. And btw, onVehicleDamage has only one parameter exported, loss. See http://development.mtasa.com/index.php? ... icleDamage for more about it
darkdreamingdan Posted February 27, 2009 Posted February 27, 2009 Server damage events dont support cancelEvent anyway.
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