Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Revive Plugin for RR Servers
Re: Revive Plugin for RR Servers [message #352177 is a reply to message #352104] Fri, 26 September 2008 06:59 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
With that; we can suggest improvements for you.

I'd do it like this:

int Team = Get_Team(ID);
GameObject *Building = 0;
if(Text[1] == "pp")
{
   if(!ini->Get_Bool("Settings", "Allow_Revive_Power_Plants", 0))
   {
       //not allowed
       return;
   }

   Building = Find_Power_Plant(Team));
}
else if(...)
{

}
else
{
   //invalid selection
   return;
}

if(!Building || !Commands->Get_ID(Building))
{
   //error
   return;
}

float Cost = /*Get cost */;


if(!Purchase_Item(Get_GameObj(ID), Cost))
{
   //not enough money
   return
}

Attach_Script_Once(Building, "RR
Commands->Attach_Script(bar, "RR_ReviveBuilding", "");
char msg[256];
sprintf(msg, "msg %S has revived the %s", Get_Wide_Player_Name_By_ID(ID), Translate_Preset(Building));
Console_Input(msg);

[Updated on: Fri, 26 September 2008 07:00]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Harvester won't work
Next Topic: Glacier_Flying spawners
Goto Forum:
  


Current Time: Thu Dec 12 06:48:17 MST 2024

Total time taken to generate the page: 0.00733 seconds