Jump to content

heal gun


joedajoester

Recommended Posts

setWeaponProperty doesn't allow negative values.

You can do this though:

-- client side:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if (weapon == 31 and hitElement and getElementType(hitElement)=="vehicle") then -- If the weapon is a M4 and the element hit is a vehicle 
          if getElementHealth(hitElement) >= 1000 then return end -- If the vehicle health is 1000%, don't heal it. 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) -- Set the vehicle health +100%. 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

-- server side:

addEventHandler("onResourceStart",resourceRoot, 
function () 
    setWeaponProperty(31, "pro", "damage", 0) 
end) 

This way it won't damage the vehicle at all, but it should heal it.

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