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);
[Updated on: Fri, 20 June 2008 07:03]
Report message to a moderator