Post: BO2 Give Weapon Function, Weapons Get Taken Away
07-31-2017, 06:02 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hello, I'm having trouble with the give weapons function on zombies in the GSC Managed Code List thread, here's the code I currently have:

    
giveWeapon
{
self giveWeapon(weapon);
self switchToWeapon(weapon);
self iPrintln("Weapon ^2Given");
}


When I use the code I get the weapon but then it gets taken away and you hear that zombies laughing sound, so I need to add anything to fix this? Thanks.
07-31-2017, 06:39 PM #2
KrazyKandy
I am error
Because you have too many weapons, it takes them all away and resets your points because the game thinks you're cheating. Simply have it take away your current weapon before giving the new one.

The following user groaned KrazyKandy for this awful post:

anthonything
07-31-2017, 07:34 PM #3
Originally posted by KrazyKandy View Post
Because you have too many weapons, it takes them all away and resets your points because the game thinks you're cheating. Simply have it take away your current weapon before giving the new one.

So, like this?

    
giveWeapon(weapon)
{
self takeWeapon(weapon);
self giveWeapon(weapon);
self switchToWeapon(weapon);
self giveMaxAmmo(weapon);
self iPrintln("Weapon ^2Given");
}
08-01-2017, 05:28 AM #4
anthonything
Space Ninja
Originally posted by quacked420 View Post
So, like this?

    
giveWeapon(weapon)
{
self takeWeapon(weapon);
self giveWeapon(weapon);
self switchToWeapon(weapon);
self giveMaxAmmo(weapon);
self iPrintln("Weapon ^2Given");
}


Do one of the following:
level.player_too_many_weapons_monitor = 0;

or
level.get_player_weapon_limit = ::get_player_weapon_limit;
get_player_weapon_limit( player )
{
return 25;
}

The following user thanked anthonything for this useful post:

quacked420

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo