Jump to content

What is wrong here?


Recommended Posts

First of all: WTF there isnt a "onClientVehicleDamage" event?!?!

Ok, so what is wrong here?

function damage1 (thePlayer) 
    h = getElementHealth ( thePlayer ) 
    setElementHealth ( thePlayer, h-10 ) 
end  
addEventHandler( "onVehicleDamage", root, damage1 ) 

debugscript 3 says "bad argument"

Link to comment

The source of this event is the vehicle that got damaged.

You are using thePlayer instead of source.

function damage1 (loss) 
    h = getElementHealth ( source ) 
    setElementHealth ( source, h-10 ) 
end 
addEventHandler( "onVehicleDamage", root, damage1 ) 

Link to comment
The source of this event is the vehicle that got damaged.

You are using thePlayer instead of source.

function damage1 (loss) 
    h = getElementHealth ( source ) 
    setElementHealth ( source, h-10 ) 
end 
addEventHandler( "onVehicleDamage", root, damage1 ) 

oh ty very much!!

Link to comment

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...