cokacola Posted October 25, 2014 Posted October 25, 2014 Hi. I'd like to stop vehicles exploding and rather just leave them on fire(or low health) to disable them. Unfortunately, no matter how much I try, I cannot stop them exploding. Do I need to hook a clientside event for this and cancel it or what? Also known as Bizzycola. In fact, if I could change my nick to that I would.
Walid Posted October 25, 2014 Posted October 25, 2014 here you go : function cancelExplode() cancelEvent() end addEventHandler("onVehicleExplode", root, cancelExplode) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
cokacola Posted October 25, 2014 Author Posted October 25, 2014 Tried that, can't seem to cancel the explode event. Went clientside and canceled the onClientVehicleDamage if the health was below a certain point though. Did this: function handleVehicleDamage(attacker, weapon, loss, x, y, z, tyre) if getElementHealth(source) < 250 or (getElementHealth(source)-loss) < 250 then setElementHealth(source, 250) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage) In case anyone else wants to know how. Also known as Bizzycola. In fact, if I could change my nick to that I would.
arezu Posted October 25, 2014 Posted October 25, 2014 Cancel https://wiki.multitheftauto.com/wiki/OnClientExplosion
Bilal135 Posted October 25, 2014 Posted October 25, 2014 setVehicleDamageProof(getPedOccupiedVehicle(Player),false) "Get busy living or get busy dying"
Anubhav Posted October 25, 2014 Posted October 25, 2014 setVehicleDamageProof(getPedOccupiedVehicle(Player),false) Its already solved See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Bilal135 Posted October 25, 2014 Posted October 25, 2014 I didn't know, but okay. "Get busy living or get busy dying"
Moderators IIYAMA Posted October 25, 2014 Moderators Posted October 25, 2014 You can also prevent the explosions of the vehicles, but this will not prevent them to be able blown. https://wiki.multitheftauto.com/wiki/OnClientExplosion You can cancel: 4: Car 5: Car Quick 6: Boat 7: Heli local cancelTheseTypes = { [4]=true, [5]=true, [6]=true, [7]=true } addEventHandler("onClientExplosion",root, function (x,y,z,theType) if cancelTheseTypes[theType] then cancelEvent() end end) Note: sometimes heli/planes explode using the rocket explosion. (happens when they are already exploded and they get rammed/hit by anything. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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