Estevam2d Posted October 4, 2014 Share Posted October 4, 2014 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
darhal Posted October 4, 2014 Share Posted October 4, 2014 Use if hitElement == test then Link to comment
darhal Posted October 4, 2014 Share Posted October 4, 2014 Use this in the second fucntion : if hitElement == testedois then Link to comment
Estevam2d Posted October 4, 2014 Author Share Posted October 4, 2014 I can destroy one. But the other is impossible. Link to comment
Estevam2d Posted October 4, 2014 Author Share Posted October 4, 2014 How could I forget it myself kkk' thank you for help me. I am very happy now Link to comment
Estevam2d Posted October 4, 2014 Author Share Posted October 4, 2014 Not for a while not, anything I write here. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now