This should work, probably. Works like "-name x" where x is the new name you want.
Code:
globals
Trigger trg_NameChange = CreateTrigger()
// the rest of your globals
endglobals
function NameChange_Actions takes nothing returns nothing
local string s = GetEventPlayerChatString()
local string s2 = SubString(s, 6, StringLength(s)+1)
if SubString( s, 0, 6) == "-name " then
call SetPlayerName( GetTriggerPlayer(), s2 )
endfunction
// the rest of your functions
function Main takes nothing returns nothing
// function main locals
local integer ii = 0
loop
exitwhen ii > 11
call TriggerRegisterPlayerChatEvent( trg_NameChange, Player(ii), "-name ", false )
endloop
call TriggerAddAction( trg_NameChange, function NameChange_Actions )
// the rest of function main