Post: Giving weapons/equipment correctly
10-12-2015, 08:15 PM #1
BullyWiiPlaza
Climbing up the ladder
(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 Sal
(adsbygoogle = window.adsbygoogle || []).push({});
10-12-2015, 08:51 PM #2
anthonything
Space Ninja
player maps/mp/zombies/_zm_weapons::weapon_give( weapon, 0, 0 );

The following user thanked anthonything for this useful post:

BullyWiiPlaza
10-12-2015, 08:51 PM #3
itsSorrow
In my man cave
Note Response:
Yes you can as it is not a forum.

The Other Stuff:
You can knife while doing giveWeapon(weapon); it depends on how you are doing it though. If you are just giving the weapon to him then you should be able to but if you are removing both of the weapons then no you cannot.
10-12-2015, 08:55 PM #4
anthonything
Space Ninja
and for the weapons: player notify( "stop_player_too_many_weapons_monitor" );

The following user thanked anthonything for this useful post:

BullyWiiPlaza
10-12-2015, 10:35 PM #5
iiiCenTurY
Gym leader
Originally posted by BullyWiiPlaza View Post
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 Sal


For the actionslot i beleave its: self setactionslot(1, "claymore_mp"); im Not sure tho
10-12-2015, 10:48 PM #6
BullyWiiPlaza
Climbing up the ladder
Ah, I found the solution. It's all You must login or register to view this content.. Tested and working Happy
10-13-2015, 02:29 AM #7
Adrian
Adrian is back!
Originally posted by BullyWiiPlaza View Post
Ah, I found the solution. It's all You must login or register to view this content.. Tested and working Happy


Good to hear, if you have any other questions feel free to make another thread.

-Thread Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo