function Do_Player takes nothing returns nothing
local string tempStr = ""
set tempStr = GetPlayerName(GetEnumPlayer())
call SetPlayerName( GetEnumPlayer(), "" )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = StringLength(tempStr)
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( ( GetForLoopIndexA() == 1 ) ) then
if (( SubStringBJ(tempStr, GetForLoopIndexA(), GetForLoopIndexA()) == "_" ) ) then
call SetPlayerName( GetEnumPlayer(), ( GetPlayerName(GetEnumPlayer()) + " " ) )
else
call SetPlayerName( GetEnumPlayer(), ( GetPlayerName(GetEnumPlayer()) + StringCase(SubStringBJ(tempStr, GetForLoopIndexA(), GetForLoopIndexA()), true) ) )
endif
else
if (( SubStringBJ(tempStr, GetForLoopIndexA(), GetForLoopIndexA()) == "_" ) ) then
call SetPlayerName( GetEnumPlayer(), ( GetPlayerName(GetEnumPlayer()) + " " ) )
else
call SetPlayerName( GetEnumPlayer(), ( GetPlayerName(GetEnumPlayer()) + SubStringBJ(tempStr, GetForLoopIndexA(), GetForLoopIndexA()) ) )
endif
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set bj_forLoopBIndex = 0
set bj_forLoopBIndexEnd = 9
loop
exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
if ( SubStringBJ(GetPlayerName(GetEnumPlayer()), StringLength(GetPlayerName(GetEnumPlayer())), StringLength(GetPlayerName(GetEnumPlayer()))) == I2S(GetForLoopIndexB()) ) then
call SetPlayerName( GetEnumPlayer(), SubStringBJ(GetPlayerName(GetEnumPlayer()), 1, ( StringLength(GetPlayerName(GetEnumPlayer())) - 1 )) )
endif
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
function SetRealNames takes nothing returns nothing
call ForForce( GetPlayersByMapControl(MAP_CONTROL_USER), function Do_Player )
endfunction