Jump to content

Fire hit


Estevam2d

Recommended Posts

How do I can destroy only the desired target?

This destroying both at the same time.

Can anyone help me?

test = createObject(2023, -2136.526, -420.095, 35.336) 
setElementCollisionsEnabled(test, true) 
  
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if weapon == 42 and getElementType(hitElement)=="object" then 
         outputChatBox ( "Fogo apagado", 255, 0, 0 ) 
         destroyElement (test) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 
  
  
testedois = createObject(2023, -2148.176, -417.507, 35.336) 
setElementCollisionsEnabled(testedois, true) 
  
function fogoum(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if weapon == 42 and getElementType(hitElement)=="object" then 
         outputChatBox ( "Fogo apagado", 255, 0, 0 ) 
         destroyElement (testedois) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), fogoum) 

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