Jump to content

help with rocket launcher damage


Recommended Posts

Posted (edited)

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
Posted
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?

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

Posted (edited)

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
Posted

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) 

Posted
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) 

thanks :)

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