You could also adapt this, which I pulled out of my RP chat mod:
function servercmdWhois(%cl, %n1, %n2, %n3, %n4, %n5)
{
%search = trim(%n1 SPC %n2 SPC %n3 SPC %n4 SPC %n5);
if(%search !$= "")
{
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%this = ClientGroup.getObject(%i);
%name = %this.fakeName;
while((%temp = stripMLControlChars(%name)) !$= %name)
%name = %temp;
if(striPos(%name, %search) != -1)
%line[-1+%lines++] = "\c6Match "@%match++@": \"\c3"@%name@"\c6\" (Real name: \"\c3"@%this.name@"\c6\").";
}
if(%lines != 0) %cl.chatMessage("\c2Fake Name Matches:");
for(%i=0;%i<%lines;%i++) %cl.chatMessage(%line[%i]); %lines = 0;
}
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%this = ClientGroup.getObject(%i);
%name = %this.name; %fakeName = (%this.fakeName $= "" ? %name : %this.fakeName);
while((%temp = stripMLControlChars(%fakeName)) !$= %fakeName)
%fakeName = %temp;
if(%search $= "" || striPos(%name, %search) != -1)
%line[-1+%lines++] = "\c6Match "@%match++@": \"\c3"@%name@"\c6\" (Fake name: \"\c3"@%fakeName@"\c6\").";
}
if(%lines != 0) %cl.chatMessage("\c2Real Name Matches:");
for(%i=0;%i<%lines;%i++) %cl.chatMessage(%line[%i]);
}
Ctrl+H in Notepad
Put "%this.fakeName" in Find What
Put "%this.whateverVariable" in Replace With, where "whateverVariable" is the client variable for the player's fake name.
If it's player-based, use %this.player.whateverVariable instead.