Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Server Side Stuff
Re: Server Side Stuff [message #256538 is a reply to message #255939] Mon, 30 April 2007 12:41 Go to previous messageGo to previous message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma:
Recruit
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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scorpia's wwconfig2
Next Topic: Level Edit bug
Goto Forum:
  


Current Time: Fri Jan 10 02:38:15 MST 2025

Total time taken to generate the page: 0.00794 seconds