_weapons.gsc and watchPickup()
Posted: October 2nd, 2011, 8:59 pm
				
				i'm trying to make it so axis get no ammo when they pick up something or not even pick it if it's just ammo. looking back at _weapons.gsc i've found something called watchPickup() but there's nothing regarding the ammo itself.
i've tried to add a check at the top of it but it went dysfunctional and i could pick up everything (both ammo and weapons) still..
			Code: Select all
watchPickup()
{
        self endon("death");
        
        weapname = self getItemWeaponName();
        
        while(1)
        {
                self waittill( "trigger", player, droppedItem );
                
                if ( isdefined( droppedItem ) )
                        break;
                // otherwise, player merely acquired ammo and didn't pick this up
        }
        
        /#
        if ( getdvar("scr_dropdebug") == "1" )
                println( "picked up weapon: " + weapname + ", " + isdefined( self.ownersattacker ) );
        #/
 
        assert( isdefined( player.tookWeaponFrom ) );
        
        // make sure the owner information on the dropped item is preserved
        droppedWeaponName = droppedItem getItemWeaponName();
        if ( isdefined( player.tookWeaponFrom[ droppedWeaponName ] ) )
        {
                droppedItem.owner = player.tookWeaponFrom[ droppedWeaponName ];
                droppedItem.ownersattacker = player;
                player.tookWeaponFrom[ droppedWeaponName ] = undefined;
        }
        droppedItem thread watchPickup();
        
        // take owner information from self and put it onto player
        if ( isdefined( self.ownersattacker ) && self.ownersattacker == player )
        {
                player.tookWeaponFrom[ weapname ] = self.owner;
        }
        else
        {
                player.tookWeaponFrom[ weapname ] = undefined;
        }
}Code: Select all
if(self.pers["team"] == "axis")
        return;