Jump to content

Prevent vehicle from explosion


_Dark_

Recommended Posts

Posted

How to prevent vehicle from explosion when vehicle stands on a roof?

Car starts burn after turning on the roof.

 #define if while#define TRUE FALSE// problems?
Posted

This is what I do to prevent explosion:

function vehicleDamage ( loss ) 
    local vehHealth = getElementHealth ( source ) 
    if ( vehHealth < 300 ) then 
        setElementHealth ( source, 300 ) 
        setVehicleDamageProof ( source, true ) 
    end 
end 
addEventHandler ( "onVehicleDamage", root, vehicleDamage ) 

Of course, if it's hit by a rocket it may not reach to prevent it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thank you, but I know this.

But this way, vehicle won't take damage from bullets, etc.

I need disable vehicle burning (and after that — explosion) when vehicle stand on a roof.

 #define if while#define TRUE FALSE// problems?
Posted
why not ?
  
    function vehicleDamage ( loss ) 
cancleEvent() 
    end 
    addEventHandler ( "onVehicleDamage", root, vehicleDamage ) 
  

cancelEvent*

Posted
why not ?
  
    function vehicleDamage ( loss ) 
cancleEvent() 
    end 
    addEventHandler ( "onVehicleDamage", root, vehicleDamage ) 
  

Because you can't cancel it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...