This may help
Heres what i came up with really fast, Code maybe inefficent but im in a hurry
const char *Get_Powerup_Weapon(const char *Powerup); //Get the weapon name that a powerup will grant if collected
void Remove_Weapon_Player (GameObject *obj,const char *Weapon_Name){
int Number_Weapon = Get_Weapon_Count(obj);
std::string Current_Weapon;
int Location;
for (int i = 1; i <= Number_Weapon; i++) {
Current_Weapon = Get_Weapon(obj,i);
if (Current_Weapon.find(Weapon_Name)>= 0) {
Location = Current_Weapon.find("Weapon");
if (Location >= 0) Current_Weapon.replace(Location,6,"POW");
Commands->Give_Powerup(obj,Current_Weapon.c_str(),true);
}
}
}
If you're using kak_drop_weapon
So when the player picks up the powerup then do
Remove_Weapon_Player(sender,Get_Powerup_Weapon(Get_Preset_Name(obj)));
if the preset is something you dont want.