Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Renegade API C++ help needed  () 1 Vote
Re: Renegade API C++ help needed [message #366500 is a reply to message #366498] Thu, 08 January 2009 11:54 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Zack wrote on Thu, 08 January 2009 13:23

class mapChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<mapChatCommand> mapChatCommandReg("!nextmap",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map2ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map2ChatCommand> map2ChatCommandReg("!next",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map3ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map3ChatCommand> map3ChatCommandReg("!n",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map4ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map4ChatCommand> map4ChatCommandReg("!N",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map5ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map5ChatCommand> map5ChatCommandReg("!NEXT",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map6ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map6ChatCommand> map6ChatCommandReg("!NEXTMAP",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map7ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map7ChatCommand> map7ChatCommandReg("!Nextmap",CHATTYPE_ALL,0,GAMEMODE_ALL);

class map8ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
mapnameannounce();	
	}
};
ChatCommandRegistrant<map8ChatCommand> map8ChatCommandReg("!Next",CHATTYPE_ALL,0,GAMEMODE_ALL);


You can combine all those into one if I recall correctly.. :/

ChatCommandRegistrant<mapChatCommand> mapChatCommandReg("!cmd1;!cmd2;!cmd3;!cmd4;etc",CHATTYPE_ALL,0,GAMEMODE_ALL);


EDIT: I think this "srand(time(NULL));" is supposed to be called only once? :/

Also, I usually call it like: "srand((unsigned int)time(0));"



Yeah, MacKinsey already pointed that out. I didn't actualy know you was able to do that. Cool.

You can seed the random number generation once, like you suggested, but it works on the local clock I think. I just thought it wouldn't hurt to keep re-seeding the random number generation to keep it uber random. I dunno... :-/

Thanks for the input Smile



 
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: Scripts.dll/ssgm plugins on x64 systems
Next Topic: Reborn Conversion
Goto Forum:
  


Current Time: Sun Dec 22 17:16:45 MST 2024

Total time taken to generate the page: 0.00781 seconds