Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Help Chat command.
Help Chat command. [message #438060] Sun, 17 October 2010 13:51 Go to next message
crysis992 is currently offline  crysis992
Messages: 314
Registered: June 2008
Karma: 0
Recruit

Hello,

I tried to make a stealth command, but im just a beginner there, and i want that the command cost 900. But it should be set in the ssgm.ini that i can change the costs if needed.
Can anyone help me with this?

class stealthChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) 
	{

		        GameObject *obj = Get_GameObj(ID);
				Commands->Enable_Stealth(obj,1);
				Create_2D_WAV_Sound_Player(obj,"m00puss_aqob0002i1evag_snd.wav");
				FDSMessage(StrFormat("%s bought a stealth suit!",Get_Player_Name_By_ID(ID)),"_ALERT");
				
			
};
};


ChatCommandRegistrant<stealthChatCommand> stealthChatCommandReg("!stealthsuit",CHATTYPE_ALL,0,GAMEMODE_ALL);



+ another request.
Atm it give me a character stealth suit, whats the code for to stealth a vehicle?


,
crysis992
Re: Help Chat command. [message #438117 is a reply to message #438060] Tue, 19 October 2010 08:17 Go to previous messageGo to next message
crysis992 is currently offline  crysis992
Messages: 314
Registered: June 2008
Karma: 0
Recruit

None can help me? :/
Re: Help Chat command. [message #438119 is a reply to message #438060] Tue, 19 October 2010 08:56 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
To enable stealth on a vehicle just call
Commands->Enable_Stealth(<VEHICLE_OBJECT_HERE>, 1);


To make it cost 900 do this
int cost = 900;
int curMoney = Commands->Get_Money(obj);

if(curMoney >= cost)
{
    Commands->Give_Money(obj, -cost, 0);
}


To read a (int) value from an INI do this
INIClass *myINI = Get_INI("mydir\\myini.ini");

int cost = myINI->Get_Int("CATEGORY", //In the ini this looks like [CATEGORY]
                          "ENTRYNAME", //In the INI this looks like ENTRYNAME=1234
                          900); //Default value


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Help Chat command. [message #438120 is a reply to message #438060] Tue, 19 October 2010 09:39 Go to previous message
crysis992 is currently offline  crysis992
Messages: 314
Registered: June 2008
Karma: 0
Recruit

Thank you Smile
Previous Topic: Need help (tank modeling)
Next Topic: Good Huds
Goto Forum:
  


Current Time: Sun Sep 01 15:17:16 MST 2024

Total time taken to generate the page: 0.02789 seconds