Drakath Posted June 12, 2014 Posted June 12, 2014 When someone throws a grenade at a vehicle, script sets its health to 450 but it still explodes. Why?
MIKI785 Posted June 12, 2014 Posted June 12, 2014 When do you set the health? Lua Scripter Owner of mshost.cz MTA portal.
MIKI785 Posted June 12, 2014 Posted June 12, 2014 I don't think that that gets triggered at all.. you're looking for this: onClientProjectileCreation. But still that gets called before the grenade explodes. Lua Scripter Owner of mshost.cz MTA portal.
Drakath Posted June 12, 2014 Author Posted June 12, 2014 Oh, it does not pass vehicle as hitElement condition. Is there any other way to detect when grenade hits a vehicle?
MIKI785 Posted June 12, 2014 Posted June 12, 2014 But still.. it gets called before it explodes... youre setting the health before it gets damaged. Maybe onClientVehicleDamage. Lua Scripter Owner of mshost.cz MTA portal.
Drakath Posted June 12, 2014 Author Posted June 12, 2014 When it gets damaged it does not explode instantly so setting the health would prevent it from exploding. Anyway, with onClientVehicleDamage I cannot check if it was grenade what hit the vehicle.
Max+ Posted June 12, 2014 Posted June 12, 2014 Maybe this , would help , getPedTarget - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Drakath Posted June 12, 2014 Author Posted June 12, 2014 Well, it works when I actually aim (right mouse button) but no one does that with grenades. Any other way?
Max+ Posted June 13, 2014 Posted June 13, 2014 This May work , addEventHandler('onClientPlayerWeaponFire', root , -- event function ( weapon , hitElement , hitX, hitY, hitZ ) -- Parameters if ( weapon == 16 and getElementType( hitElement )== "vehicle" )then -- if the weapon was grenade and the element got hit was vehicle then createExplosion (hitX, hitY, hitZ, 2, true, 0, true ) --- make an explosion( rocket ) at the place the grenade was hit and it will make the vehicle blow instantly end end ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
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