erisP Posted July 15, 2021 Share Posted July 15, 2021 I'm using a damage system, some teams can't damage each other. but with createweapon Every player can be harmed in the vehicle where I set up a weapon. How do I fix this? Link to comment
DiSaMe Posted July 15, 2021 Share Posted July 15, 2021 You need to detect when the weapon hits a player using onClientPlayerDamage, check if the attacker (first parameter) is a weapon element that's not supposed to do damage and call cancelEvent. Link to comment
erisP Posted July 15, 2021 Author Share Posted July 15, 2021 sample: function start(vehicle) if getElementModel(vehicle) == 470 then local weapon = createWeapon("m4", 0, 0, 0) attachElements(weapon, vehicle, 1, -4.2, 0, 0, 30, 90) setWeaponClipAmmo(weapon, 9999) end end How can I detect the weapon I created using onClientPlayerDamage? Link to comment
DiSaMe Posted July 16, 2021 Share Posted July 16, 2021 You could store the weapon elements in a table and then check in onClientPlayerDamage if attacker is in that table. 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