Jump to content
  • 0

mta 1.2


joedajoester

Question

14 answers to this question

Recommended Posts

  • 0
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 ) 

Should work.

P.S: Is client side.

P.S2: You'll have to find a way to cancel the damage done, else it'll heal but also damage it :P.

Link to comment
  • 0
P.S2: You'll have to find a way to cancel the damage done, else it'll heal but also damage it :P.

cancelEvent?

Like this:

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 
          cancelEvent() 
          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 ) 

Link to comment
  • 0

How about this?

srun setPedStat(getRandomPlayer(), 70, 500) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "accuracy",2000) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "damage",1000) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000020) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000800) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "anim_group",13) 
crun setPedWeaponInfo(getLocalPlayer(), "silenced_pistol", "flags",0x000002) 

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