(adsbygoogle = window.adsbygoogle || []).push({});
I have been struggling to give guns or equipment to the player in a flawless way e.g. if the player is holding a gun already and doesn't have a secondary, the new gun is given. If two guns are already held, the current one is replaced. If equipment is chosen, the current equipment is removed if in the same slot and then the new equipment is given. This is troublesome to do correctly because there are countless issues that can/will arise.
The function
getWeaponsListPrimaries() is supposed to return all primary weapons held by the player but it doesn't work correctly. It returns
Galvaknuckles and such as well. I was planning to use it to detect whether there are one or two guns held but nope. On Zombies if I give an upgraded gun and then another one the game takes both of them away, my score drops to 0 and I hear Zombies laughing. WTF is this?
Also giving a new lethal such as Semtex doesn't work if my current lethal is something other than Semtex, e.g. Frags without taking them away first.
getCurrentOffhand() returns the current lethal grenade however, this doesn't work for tacticals. Is
getOffhandSecondaryClass() for tacticals then?
How do I add stuff to the equipment slot correctly such as
Claymores or
buildables?
Why is knifing not possible after giving a weapon via
giveWeapon(weapon)?
Note:
I used the CoD4 scripting reference by Zeroy for finding
Player functions but I'm not allowed to post the link there I believe