Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM Plugin] Command
[SSGM Plugin] Command [message #488986] Mon, 11 August 2014 01:04 Go to next message
roszek is currently offline  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 116 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 Go to previous messageGo to next message
Neijwiert is currently offline  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 #488998 is a reply to message #488987] Mon, 11 August 2014 12:56 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
I really don't think I need a destructor but I could be wrong :/
Re: [SSGM Plugin] Command [message #488999 is a reply to message #488986] Mon, 11 August 2014 15:51 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
No what i mean is that your data in your list could be overwritten by something else if im right.
Re: [SSGM Plugin] Command [message #489001 is a reply to message #488986] Mon, 11 August 2014 19:55 Go to previous messageGo to next message
Whitedragon is currently offline  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 #489017 is a reply to message #488986] Fri, 15 August 2014 06:07 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
updated: Made a change were you no longer need to add a command count in the ssgm.ini.
Re: [SSGM Plugin] Command [message #489018 is a reply to message #488986] Fri, 15 August 2014 06:12 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
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 #489020 is a reply to message #489018] Fri, 15 August 2014 06:55 Go to previous messageGo to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
I tested it with an empty string and it just prints nothing. :/

Edit: I added it cuz probably better off. Neutral

Thanks.

[Updated on: Fri, 15 August 2014 07:09]

Report message to a moderator

Re: [SSGM Plugin] Command [message #489022 is a reply to message #488986] Fri, 15 August 2014 08:13 Go to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
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
Previous Topic: [SSGM Plugin] Ping
Next Topic: [SSGM Plugin] CheckPlayerName
Goto Forum:
  


Current Time: Sat Nov 23 15:24:56 MST 2024

Total time taken to generate the page: 0.00867 seconds