Jump to content

Damage projectile


-Doc-

Recommended Posts

function damage(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon == 21 and getElementModel(source) == 432 then  
        setElementHealth(source,getElementHealth(source) - 250)  
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, damage) 

try this

Raino will take 25% heath when you fire with projectile id 21

Link to comment
function damage(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon == 21 and getElementModel(source) == 432 then  
        setElementHealth(source,getElementHealth(source) - 250)  
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, damage) 

try this

Raino will take 25% heath when you fire with projectile id 21

forum and i used it+not working

its from

Link to comment

sorry there was a missing ")" in the script

and it should work, i posted this same example long back and it worked for him.

function damage(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon == 21 and getElementModel(source) == 432) then 
        setElementHealth(source,getElementHealth(source) - 250) 
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, damage) 

to find rthe actual id of the weapon try this

outputDebugString("Test: weaponid: " .. tostring(weapon)) 

or alternatively you can use the id 51 (It's the explostion id)

same issue

viewtopic.php?f=91&t=86150&start=15#p780074

Link to comment
not working :twisted:

Kidding?

It works fine for me and everyone else

Post the code which you are using

im not kidding and its server or client

function damage(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon == 21 and getElementModel(source) == 432) then 
        setElementHealth(source,getElementHealth(source) - 250) 
        --outputDebugString("Test: weaponid: " .. tostring(weapon)) 
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, damage) 

Link to comment
not working :twisted:

Kidding?

It works fine for me and everyone else

Post the code which you are using

im not kidding and its server or client

function damage(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon == 21 and getElementModel(source) == 432) then 
        setElementHealth(source,getElementHealth(source) - 250) 
        --outputDebugString("Test: weaponid: " .. tostring(weapon)) 
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, damage) 

It's client

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