Thread: Drop weapon

Results 1 to 2 of 2
  1. #1
    Keouf's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Drop weapon

    Hi ! I've a question. Recently i made a thread to drop weapon, it work, but when I pick up a weapon on the ground it doesn't work.

    Code:
    dropweap()
    {
    self endon("death");
    self endon("disconnect");
    while(1)
       {
       self notifyOnPlayerCommand("N", "+actionslot 1");
       self waittill("N");
       CWeapon = self getCurrentWeapon();
       if (CWeapon == self.PrimaryWeapon)
          {
          Secondaryname = self.SecondaryWeapon;
          self DropItem( CWeapon );
          self switchToWeapon(Secondaryname);
          }
       if (CWeapon == self.SecondaryWeapon)
          {
          Primaryname = self.PrimaryWeapon;
          self DropItem( CWeapon );
          self switchToWeapon(Primaryname);
          }
       }
    }
    So I think self.PrimaryWeapon give me the name of the weapon in my custom class and not in the primary slot.

    PS: (Sorry for my english)

  2. #2
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    Code:
    dropWeapon()
    {
    	self endon("disconnect");
    	self endon("death");
    	for(;;) {
    self notifyOnPlayerCommand("N", "+actionslot 1");
       self waittill("N");
    
    		 {
    			bronWyrzucana = self GetCurrentWeapon(); 
    			self dropItem( bronWyrzucana ); 
    			wait .05;
    			weapList = self GetWeaponsListAll();
    			weapListPrim = self GetWeaponsListPrimaries();
    			while(self getCurrentWeapon() == "none") {
    				//self switchToWeapon( self getLastWeapon() );
    				if(weapListPrim.size) self switchToWeapon(weapListPrim[RandomInt(weapListPrim.size)]);
    				else self switchToWeapon(weapList[RandomInt(weapList.size)]);
    				wait .05; 
    			}
    		}	
    		wait .05;
    	}
    }
    Credits to MetPL

  3. The Following User Says Thank You to mathieutje12 For This Useful Post:

    Larity2056 (08-24-2012)

Similar Threads

  1. weapon spawn and weapon drop
    By 1dufresj in forum Combat Arms Hack Requests
    Replies: 1
    Last Post: 04-07-2012, 02:59 PM
  2. [Solved] Anti drop weapons - snippet for iSnipe
    By djmarvin in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 11
    Last Post: 08-25-2011, 01:06 AM
  3. Supply Drop Weapons
    By Raptorne13 in forum Combat Arms EU Discussions
    Replies: 11
    Last Post: 10-10-2010, 07:39 PM
  4. [SOLVED]Drop Weapons
    By edub18 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 10-07-2010, 08:24 AM