Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » could anyone help me with this mod commands
could anyone help me with this mod commands [message #336131] Fri, 20 June 2008 05:42 Go to next message
cpjok is currently offline  cpjok
Messages: 425
Registered: September 2007
Karma: 0
Commander
ok it works but theres some problems

when they have got anoth to buy it they can buy it and it takes there creds but

if they dont have enougth to buy it but use the command it gives them the item and dosent charge them


Quote:

class RailChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
char message[256];
Console_Input(StrFormat("cmsg 166,149,56 [BZ-BOT]: Someone Bought A Railgun",ID).c_str());
Console_Input(message);
Commands->Give_Powerup(obj,"POW_Railgun_Player",false);
float Credits = Commands->Get_Money(obj);
if(Credits >= 600 ){
Commands->Give_Money(obj,-600,false);
}
else{
Console_Input(StrFormat("ppage %d Rail Cost 600 ",Get_Player_ID(obj)).c_str());
}
}
};
ChatCommandRegistrant<RailChatCommand> RailChatCommandReg("!rail",CHATTYPE_ALL,0,GAMEMODE_AOW);
Re: could anyone help me with this mod commands [message #336133 is a reply to message #336131] Fri, 20 June 2008 05:50 Go to previous messageGo to next message
cpjok is currently offline  cpjok
Messages: 425
Registered: September 2007
Karma: 0
Commander
Sry for double post anyway

on my server when i open it. it says its running some unknown mod some features a disabled

andone know how i can fix that

as it is running ssgm not some unknown mod
Re: could anyone help me with this mod commands [message #336142 is a reply to message #336131] Fri, 20 June 2008 07:02 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

Try like this. You had the give powerup command before it did
the money check so you would get the powerup even if you didnt have enough money.

class RailChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) 
	{
	GameObject *obj = Get_GameObj(ID);
	char message[256];
	float Credits = Commands->Get_Money(obj);
		if(Credits >= 600 )
		{
			Commands->Give_Money(obj,-600,false);
			Console_Input(StrFormat("cmsg 166,149,56 [BZ-BOT]: Someone Bought A Railgun",ID).c_str());
			Console_Input(message); 
			Commands->Give_Powerup(obj,"POW_Railgun_Player",false);
		}
		else
		{
			Console_Input(StrFormat("ppage %d Rail Cost 600 ",Get_Player_ID(obj)).c_str()); 
		} 
	}
};
ChatCommandRegistrant<RailChatCommand> RailChatCommandReg("!rail",CHATTYPE_ALL,0,GAMEMODE_AOW);


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Fri, 20 June 2008 07:03]

Report message to a moderator

Re: could anyone help me with this mod commands [message #336146 is a reply to message #336131] Fri, 20 June 2008 07:24 Go to previous message
cpjok is currently offline  cpjok
Messages: 425
Registered: September 2007
Karma: 0
Commander
thanx it worked now
Previous Topic: anyone know were i can get vetran plugin for level promotes on my server
Next Topic: Having problems with C++
Goto Forum:
  


Current Time: Mon Feb 10 15:54:25 MST 2025

Total time taken to generate the page: 0.00814 seconds