| [SSGM Plugin] Command [message #488986] | 
			Mon, 11 August 2014 01:04   | 
		 
		
			
				
				
				  | 
					
						  
						roszek
						 Messages: 296 Registered: June 2010 
						
	Karma: 0
 
					 | 
					Recruit  | 
					 | 
		 
		 
	 | 
 
	
		This plugin is for players to view available SSGM commands. 
use !commands or !cmd 
 
Add the command list into the ssgm.ini under [Commands]. You just add a number after the word Command for every command you want to list. 
 
for example: 
[Plugins]
00=BanSystem.dll
01=Mute.dll
02=Command.dll
[Commands]
Command1=!ping
Command2=!donate
Command3=!teamdonate
Command4=!swap
Command5=!cswap  
		
	- 
	
 
	Attachment: Command.rar
	 
	(Size: 11.15KB, Downloaded 208 times)
 
 
		
		[Updated on: Fri, 15 August 2014 08:41] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	
		
		
			| Re: [SSGM Plugin] Command [message #488987 is a reply to message #488986] | 
			Mon, 11 August 2014 02:39    | 
		 
		
			
				
				
				
					
						  
						Neijwiert
						 Messages: 124 Registered: October 2009 
						
	Karma: 0
 
					 | 
					Recruit  | 
					 | 
		 
		 
	 | 
 
	
		I'm not entirely sure but when you call "command_list.Add(command);" doesn't "StringClass command" go out of scope after "void Command::OnLoadGlobalINISettings(INIClass *SSGMIni)"? Becouse "bool Add(T const &object)" asks for a constant adress of object so it wont call the copy constructor? 
 
Otherwise it's nice though.
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	
		
		
			| Re: [SSGM Plugin] Command [message #489001 is a reply to message #488986] | 
			Mon, 11 August 2014 19:55    | 
		 
		
			
				
				
				  | 
					
						  
						Whitedragon
						 Messages: 832 Registered: February 2003  Location: California
						
	Karma: 1
 
					 | 
					Colonel  | 
					 | 
		 
		 
	 | 
 
	
		It's fine since he's using DynamicVectorClass<StringClass>; the vector will create a new StringClass for each object. If it were DynamicVectorClass<StringClass*> you would be correct.
		
		
  Black-Cell.net 
Network Administrator (2003 - ) 
 
DragonServ, Renegade's first IRC interface bot 
Creator and lead coder (2002 - ) 
 
Dragonade, Renegade's first server side modification 
Lead coder (2005 - )
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: [SSGM Plugin] Command [message #489018 is a reply to message #488986] | 
			Fri, 15 August 2014 06:12    | 
		 
		
			
				
				
				
					
						  
						iRANian
						 Messages: 4313 Registered: April 2011 
						
	Karma: 1
 
					 | 
					General (4 Stars)  | 
					 | 
		 
		 
	 | 
 
	
		You need to add a small change to make sure the empty string "" doesn't get added to the commands list: 
 
			SSGMIni->Get_String(command, "Commands", StringClass::getFormattedString("Command%d", i+1), "");
			
			if (command == "") { continue;  }
			command_list.Add(command); 
		
		
  Long time and well respected Renegade community member, programmer, modder and tester. 
 
Scripts 4.0 private beta tester since May 2011. 
 
My Renegade server plugins releases
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: [SSGM Plugin] Command [message #489022 is a reply to message #488986] | 
			Fri, 15 August 2014 08:13   | 
		 
		
			
				
				
				
					
						  
						iRANian
						 Messages: 4313 Registered: April 2011 
						
	Karma: 1
 
					 | 
					General (4 Stars)  | 
					 | 
		 
		 
	 | 
 
	
		Yes, it makes no difference as the plugin prints the content of the  commands StringClass vector and the plugin will add empty strings (""), but it's good programming practice to internalize so you don't get any issues when you're using the same method to read in a list in the future.
		
		
  Long time and well respected Renegade community member, programmer, modder and tester. 
 
Scripts 4.0 private beta tester since May 2011. 
 
My Renegade server plugins releases
		
 |  
	| 
		
	 | 
 
 
 |