Jump to content

help with rocket launcher damage


Recommended Posts

I was trying make vehicles get less damage from rocket launcher

one of my friend told to use these functions to do that

OnClientVehicleDamage

CancelEvent

GetElementHealth

SetElementHealth

I made the vehicle damage proof with weapons but not able to set vehicle heath with SetElementHealth

  
function fakyu(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon) then 
        cancelEvent() 
    end 
 setElementHealth(source,getElementHealth(source) - 50)  
end 
addEventHandler("onClientVehicleDamage", root, fakyu) 

Edited by Guest
Link to comment
function fakyu(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon) then 
        cancelEvent() 
    end 
 setElementHealth(source,getElementHealth(source) - 50) 
end 
addEventHandler("onClientVehicleDamage", root, fakyu) 

what do you want achieve with this?

Link to comment
function fakyu(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon) then 
        cancelEvent() 
    end 
 setElementHealth(source,getElementHealth(source) - 50) 
end 
addEventHandler("onClientVehicleDamage", root, fakyu) 

what do you want achieve with this?

I want vehicle to get less damage from weapons, even rocket launcher should do less damage to vehicle.

ik there is a function setWeaponProperty but it doesn't work with rocket laucher.

Link to comment

ok Here's a clear explanation on what i'm trying to make

I wanted to reduce damage from rocket launcher to vehicle, Rocket launcher should only take 50% of heath of the enemy car

my friend said that you can use these to functions do that

OnClientVehicleDamage

CancelEvent

GetElementHealth

SetElementHealth

function fakyu(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon) then 
        cancelEvent() 
    end 
 setElementHealth(source,getElementHealth(source) - 50) 
end 
addEventHandler("onClientVehicleDamage", root, fakyu) 

but not able to do that

Edited by Guest
Link to comment

try this:

function fakyu(attacker, weapon, loss, x, y, z, tyre) 
    if (weapon and getElementType(source) == "vehicle") then 
        setElementHealth(source,getElementHealth(source) - 50)   
        cancelEvent() 
    end 
end 
addEventHandler("onClientVehicleDamage", root, fakyu) 

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