FuriouZ Posted April 17, 2014 Posted April 17, 2014 Hello! My question is how i can check how many damage the vehicle is taken ? For example, if vehicle is driving into the wall, how i can check how many damage vehicle got ? Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
Gallardo9944 Posted April 17, 2014 Posted April 17, 2014 onClientVehicleDamage Code Debugger - Minimalistic MTA debug line replacement
cheez3d Posted April 17, 2014 Posted April 17, 2014 The event "onVehicleDamage" has the loss parameter. https://wiki.multitheftauto.com/wiki/OnVehicleDamage
FuriouZ Posted April 17, 2014 Author Posted April 17, 2014 onClientVehicleDamage Yes, i know, but i wan't to do that if vehicle got more than 30% damage on wall hitting, then the car blows up Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
FuriouZ Posted April 17, 2014 Author Posted April 17, 2014 The event "onVehicleDamage" has the loss parameter.https://wiki.multitheftauto.com/wiki/OnVehicleDamage Thanks, it worked perfectly ! Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
FuriouZ Posted April 17, 2014 Author Posted April 17, 2014 I have another question, how i can check if vehicle is falling ? isVehicleOnGround ? Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
.:HyPeX:. Posted April 17, 2014 Posted April 17, 2014 I have another question, how i can check if vehicle is falling ?isVehicleOnGround ? you should check the vehicle velocity within some time (id say client render) local vx,vy,vz = getElementVelocity(vehicle) if vz < 0 then if not isVehicleOnGround(vehicle) --falling in Z position (CHECK THAT GOING DOWN A HILL WITH A SMALL JUMP WILL ALSO DO THIS POSITIVE) end end My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
FuriouZ Posted April 17, 2014 Author Posted April 17, 2014 Bad argument @ isVehicleOnGround addEventHandler("onVehicleDamage", root, function( loss, vehicle, seat, jacked ) local g_Vehicle = getVehicleOccupant(source) local vx,vy,vz = getElementVelocity(g_Vehicle) if vz < 0 then if not isVehicleOnGround(vehicle) then if ( tonumber( loss ) >= 350 ) then blowVehicle ( source ) end end end end ) Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
cheez3d Posted April 17, 2014 Posted April 17, 2014 addEventHandler("onVehicleDamage",root,function(loss) --local player = getVehicleOccupant(source,0) //no need to use this local _,_,vz = getElementVelocity(source) if vz>0 and not isVehicleOnGround(source) and loss >=350 then blowVehicle(source) end end)
FuriouZ Posted April 17, 2014 Author Posted April 17, 2014 Thanks Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
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