| 
		
			| Add Scripts [message #300952] | Tue, 04 December 2007 10:54  |  
			| 
				
				|  |  mrãçķz Messages: 3069
 Registered: August 2007
 
	Karma: 0
 | General (3 Stars)Permabanned for trying and failing DDoS
 |  |  |  
	| Hey guys how can i make scripts for Scripts.dll? i want to add some  commands like !Help to get a message. What files do i need to create? Only a .cpp file? and how can i add a command to scripts.dll?  im Using Visual C++ 2005 Express Edition. |  
	|  |  | 
	|  | 
	|  | 
	| 
		
			| Re: Add Scripts [message #300964 is a reply to message #300952] | Tue, 04 December 2007 11:15   |  
			| 
				
				
					|  cnc95fan Messages: 1261
 Registered: July 2007
 
	Karma: 0
 | General (1 Star) |  |  |  
	| Well, if you have the code.. just add it to a cpp file in scripts soruce, and compile... make sure you declare it by using void |  
	|  |  | 
	|  | 
	| 
		
			| Re: Add Scripts [message #300976 is a reply to message #300952] | Tue, 04 December 2007 11:52   |  
			| 
				
				|  |  reborn Messages: 3231
 Registered: September 2004
 Location: uk - london
 
	Karma: 0
 | General (3 Stars) |  |  |  
	| Add this to gmmain.cpp and compile it, then when you type "!help" in team chat it will page you the string in the quote marks. This is based on ssgm.
 
 
 
 class helpChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
Console_Input(StrFormat("ppage %d available commands to use in this server are !rules !host !servername !version",ID).c_str());
	}
};
ChatCommandRegistrant<helpChatCommand> helpChatCommandReg("!help",CHATTYPE_TEAM,0,GAMEMODE_ALL);
 
 
 |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: Add Scripts [message #301240 is a reply to message #300952] | Wed, 05 December 2007 13:15   |  
			| 
				
				
					|  cnc95fan Messages: 1261
 Registered: July 2007
 
	Karma: 0
 | General (1 Star) |  |  |  
	| lol,I don't think when you compile it it goes to your FDS folder, also, make a .h file aswell in scrips.vcproj |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: Add Scripts [message #301491 is a reply to message #300952] | Thu, 06 December 2007 14:51   |  
			| 
				
				
					| Genesis2001 Messages: 1397
 Registered: August 2006
 
	Karma: 0
 | General (1 Star) |  |  |  
	| You're probably referring to when it's linking to the libraries SSGM/Scripts.dll uses, no? 
 There's a post somewhere on these forums that explains how to set it up, but I'm too lazy to find the post. :\
 
 
 ~MathK1LL
 |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: Add Scripts [message #301506 is a reply to message #300952] | Thu, 06 December 2007 15:36   |  
			| 
				
				
					| raven Messages: 595
 Registered: January 2007
 Location: Toronto, Ontario
 
	Karma: 0
 | Colonel |  |  |  
	| The SSGM source doesnt need to be in the FDS folder.. 
 When you download SSGM, there is a .zip file in it called SSGM Source.zip.. extract that and open SSGM.sln. MS VC++ will open up and you will able to edit the source. Make your edits and build the source. You will then notice scripts.dll inside the directory that SSGM.sln was in. Copy this to your FDS directory overwriting the old version.
 
 -Jelly Administrator
 -Exodus Administrator
 |  
	|  |  | 
	| 
		
			| Re: Add Scripts [message #301540 is a reply to message #301506] | Thu, 06 December 2007 18:32  |  
			| 
				
				
					| Genesis2001 Messages: 1397
 Registered: August 2006
 
	Karma: 0
 | General (1 Star) |  |  |  
	| | RFraven wrote on Thu, 06 December 2007 15:36 |  | The SSGM source doesnt need to be in the FDS folder..
 
 When you download SSGM, there is a .zip file in it called SSGM Source.zip.. extract that and open SSGM.sln. MS VC++ will open up and you will able to edit the source. Make your edits and build the source. You will then notice scripts.dll inside the directory that SSGM.sln was in. Copy this to your FDS directory overwriting the old version.
 
 | 
 
 
 
 I highly recommend you change the extension from ".dll" to ".bak" or similar. This way you can easily revert back incase you need to.
 
 
 Also, to help you develop for Scripts.dll/SSGM, you'll want to attach the debugger of Visual Studio to server.dat (the process when the server is running). This'll detect any crashes from the server and pinpoint the location of the crash to the line number the crash occured..
 
 ~MathK1LL
 |  
	|  |  |