Jump to content

heal gun


joedajoester

Recommended Posts

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I'm pretty sure you put the client side as a server side script (in meta.xml).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Well, I damaged a vehicle and then I shoot at it and it "healed" it.

How's your meta.xml?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

See? you have both as server side...

    "dfsdssdsdasd" name="heal gun" version="1.0.0" type="script"/> 
    
    
    

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What do you mean? I don't understand.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Doesn't setElementHealth repair that too?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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