ItsMods

Full Version: Ignoring Weapon Pickup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello again. In my mod, people have various guns. I want to make it so that you cant press your "use" key to pick up a weapon off of the ground after someone dies. Is there any code for that?
(08-02-2011, 14:55)GoldenWrapper Wrote: [ -> ]Hello again. In my mod, people have various guns. I want to make it so that you cant press your "use" key to pick up a weapon off of the ground after someone dies. Is there any code for that?

Code:
init()
setDvar("scr_disable_weapondrop", 1);
(08-02-2011, 14:58)iBanana Wrote: [ -> ]
(08-02-2011, 14:55)GoldenWrapper Wrote: [ -> ]Hello again. In my mod, people have various guns. I want to make it so that you cant press your "use" key to pick up a weapon off of the ground after someone dies. Is there any code for that?

Code:
init()
setDvar("scr_disable_weapondrop", 1);

ok, so i put in a separate function but it is giving me an error.
Code:
noPickup()
{
    self endon( "disconnect" );
    for(;;)
    {
        init()
        setDvar("scr_disable_weapondrop", 1);
    }
}
you must put

setDvar("scr_disable_weapondrop", 1);

inside the thread init()
To disable the dropping of certain weapons I advice the addLimitedWeapon function.

For example, to disable the ak47 drop, use:
level maps\mp\gametypes\_weapons::addLimitedWeapon( "ak47_mp", self, 0 );

First value is the weapon file, second one is the entity on where to apply the function, and the third one is the maximum dropped weapons.

You can also use the mayDropWeapon function (it's also in _weapons.gsc):

Add after the opening bracket:
if( weapon == "weaponfile_mp" )
return false;
setDvar("scr_disable_weapondrop", 1);

EDIT:

oops, didnt lokk at the other posts : P
nvm, i got it guys thanks!