Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM Plugin] SpaceOut
[SSGM Plugin] SpaceOut [message #474075] Fri, 07 September 2012 17:36 Go to next message
roszek is currently offline  roszek
Messages: 296
Registered: June 2010
Karma: 0
Recruit
After going through some source code of one of iran's plugins (that one called "join name regulator"), I threw together a simple plugin that changes spaces in nicks to underscores.

It seems to work and did not crash any servers I tested it on.

For 4.0

Toggle Spoiler


index.php?t=getfile&id=14461&private=0

  • Attachment: SpaceOut.rar
    (Size: 9.20KB, Downloaded 102 times)
  • Attachment: so.jpg
    (Size: 30.87KB, Downloaded 325 times)

[Updated on: Sat, 08 September 2012 06:02]

Report message to a moderator

Re: [SSGM Plugin] SpaceOut [message #474112 is a reply to message #474075] Sat, 08 September 2012 14:29 Go to previous message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
This should work too.

bool Replace_Spaces_Name(int id)
{
	StringClass name = StringClass(Find_Player(id)->PlayerName);
	bool foundSpace = false;

	for (int i = 0, e = name.Get_Length(); i < e; i++)
	{
		if( name[i] == ' ')
		{
			name[i] = '_';
			foundSpace = true;
		}
	
	}

	if( foundSpace )
	{	
            Find_Player(ID)->PlayerName = name;
            return true; 
        }
        return false;	
}


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 4.0 Plugin] Join Name Regulator
Next Topic: [SSGM 4.0 Plugin] Set Deaths Console Command
Goto Forum:
  


Current Time: Sat Apr 13 10:09:28 MST 2024

Total time taken to generate the page: 0.00609 seconds