Raised This Month: $ Target: $400
 0% 

Rename MW2 Player Names


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cigs
Senior Member
Join Date: Jul 2006
Old 01-09-2010 , 10:05   Rename MW2 Player Names
Reply With Quote #1

How would I rename player names in L4D2 when they have certain symbols in them; specifically these: ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, ^9, ^0

Some Mordern Warfare 2 players have color codes in their names. Example '^1Mad ^3Dog' That one makes 'Mad' red en 'Dog' yellow in MW2. That just a simple example. Some names just look totally weird and are unreadable.

In essence the plugin should rename a name like '^1Mad ^3Dog' into 'Mad Dog'.

Thanks.
__________________
cigs is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 01-09-2010 , 10:27   Re: Rename MW2 Player Names
Reply With Quote #2

PHP Code:
SetClientInfo(client"name"szNewName); 
(from scripting\playercommands\rename.sp)
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 01-09-2010 , 10:51   Re: Rename MW2 Player Names
Reply With Quote #3

Not tested:
PHP Code:
stock RemoveMWSymbols(String:szNamemaxlen)
{
    new 
String:szMWCode[5];
    
    for (new 
0<= 9i++)
    {
        
Format(szMWCodesizeof(szMWCode), "^%d"i);
        
ReplaceString(szNamemaxlenszMWCode"");
    }

__________________
For admins: My plugins

For developers: Colors library

Last edited by exvel; 01-09-2010 at 10:53.
exvel is offline
Send a message via ICQ to exvel
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 01-09-2010 , 14:24   Re: Rename MW2 Player Names
Reply With Quote #4

exvel you forgot to reset the player's name .
__________________
Greyscale is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 01-09-2010 , 14:37   Re: Rename MW2 Player Names
Reply With Quote #5

Quote:
Originally Posted by Greyscale View Post
exvel you forgot to reset the player's name .
Well, never tried this. I hope author will figure out how it works.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
cigs
Senior Member
Join Date: Jul 2006
Old 01-20-2010 , 17:27   Re: Rename MW2 Player Names
Reply With Quote #6

I though I'd figure out how to write up the plugin, but it appears I can't. Been looking like crazy, so I give up for now.

Any additional help is always welcome.
__________________
cigs is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-20-2010 , 17:53   Re: Rename MW2 Player Names
Reply With Quote #7

I wrote code that does this, but its in c++ so not really helpful here. Basically you just need to search the string for each color code, and replace it with the source version. So search the players name for ^1 and replace it with \x04 or replace ^2 with \x05 and so on.
CrimsonGT is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode