diegofkda Posted April 3, 2011 Share Posted April 3, 2011 First of all: WTF there isnt a "onClientVehicleDamage" event?!?! Ok, so what is wrong here? function damage1 (thePlayer) h = getElementHealth ( thePlayer ) setElementHealth ( thePlayer, h-10 ) end addEventHandler( "onVehicleDamage", root, damage1 ) debugscript 3 says "bad argument" Link to comment
CowTurbo Posted April 3, 2011 Share Posted April 3, 2011 is it in meta.xml client side script ? Link to comment
diegofkda Posted April 3, 2011 Author Share Posted April 3, 2011 is it in meta.xml client side script ? This is a server-side script. Link to comment
LoveFist Posted April 3, 2011 Share Posted April 3, 2011 thePlayer will contain a float representing the amount of health the vehicle lost. Check wiki for more info about this event. Link to comment
Castillo Posted April 4, 2011 Share Posted April 4, 2011 The source of this event is the vehicle that got damaged. You are using thePlayer instead of source. function damage1 (loss) h = getElementHealth ( source ) setElementHealth ( source, h-10 ) end addEventHandler( "onVehicleDamage", root, damage1 ) Link to comment
diegofkda Posted April 4, 2011 Author Share Posted April 4, 2011 The source of this event is the vehicle that got damaged. You are using thePlayer instead of source. function damage1 (loss) h = getElementHealth ( source ) setElementHealth ( source, h-10 ) end addEventHandler( "onVehicleDamage", root, damage1 ) oh ty very much!! 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