HelpDrop weapon

Posts 1–2 of 2 · Page 1 of 1
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)
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
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us