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)