Dealman Posted July 1, 2013 Posted July 1, 2013 Before making questions like this, try to look at the MTA Wiki. Think of things like this; You need a way to see when a vehicle is destroyed, so what you need is an event. Head over to the MTA Wiki, look at Client Events - and then what you need. Right now, you need to look at Vehicle Events. In there you'll find onClientVehicleExplode which might be what you need. (onVehicleExplode for server-side) The Wiki is your best friend If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
Castillo Posted July 1, 2013 Posted July 1, 2013 There's also the "onElementDestroy" event for when an element is destroyed by destroyElement. https://wiki.multitheftauto.com/wiki/OnElementDestroy San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Spajk Posted July 1, 2013 Posted July 1, 2013 I think he's asking for a function like "isVehicleDestroyed(vehicle)" to check if vehicle has blown. I am not sure whats the best way to do it, but, this is how I would do it: First I would create an empty table called isVehicleDestroyed = {} Then I would add an event handler for "onVehicleExplode" and inside it, I would do "isVehicleDestroyed[source] = true" After that, I would add an event handler for " onElementDestroy" and do "isVehicleDestroyed[source] = nil" Then somewhere inside code I could use isVehicleDestroyed[vehicle] to check if its blown or not. Ofcourse, this way is really bad, because it doesnt detect if fixVehicle() was used and I am sure that there's a muvh simpler way using getElementHealth(), but I dont have time to experiment with it. Sorry for typing mistakes, I used my phone to type this.
PaiN^ Posted July 1, 2013 Posted July 1, 2013 isVehicleBlown " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
CaptainZ. Posted July 2, 2013 Author Posted July 2, 2013 Thank you Dealman, I used onVehicleExplode. I did it like this function destroyBlip() destroyElement(blip) end addEventHandler("onVehicleExplode", vehicleC, onvehblow)
iMr.3a[Z]eF Posted July 2, 2013 Posted July 2, 2013 Thank you Dealman, I used onVehicleExplode.I did it like this function destroyBlip() destroyElement(blip) end addEventHandler("onVehicleExplode", vehicleC, onvehblow) function destroyBlip() if ( isVehicleBlown ( vehicleC ) ) then destroyElement(blip) end end addEventHandler("onVehicleExplode", vehicleC, onvehblow) To Visit Us Press Here: mtasa://5.9.206.180:22002
PaiN^ Posted July 3, 2013 Posted July 3, 2013 @ 6ArHxiMr'3a[Z]eF : Your check is useless, since the "onVehicleExplode" event well be triggered when a vehicle blow . " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
iMr.3a[Z]eF Posted July 3, 2013 Posted July 3, 2013 @ 6ArHxiMr'3a[Z]eF : Your check is useless, since the "onVehicleExplode" event well be triggered when a vehicle blow . I really dont understand ya To Visit Us Press Here: mtasa://5.9.206.180:22002
AMARANT Posted July 3, 2013 Posted July 3, 2013 @ 6ArHxiMr'3a[Z]eF : Your check is useless, since the "onVehicleExplode" event well be triggered when a vehicle blow . I really dont understand ya He means that "onVehicleExplode" event already checks a blown vehicle, so "isVehicleBlown" function is unnecessary.
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