I'm try to rename player to custom name on spown. But, it's do not work for me.
Code:
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_SPAWNED, MyOnPlayerSpawned);
function MyOnPlayerSpawned(Player)
Player:SetCustomName("CustomName");
Player:SetName("CustomName2");
end
When I press <TAB> - i see old player name, but when I list players on server (server console) - I see new player name. Is it bug?
I don't think this is even supposed to work. The SetName() method is only useful before the player is spawned for other players, which I think happens before the PLAYER_SPAWNED hook. SetCustomName() should have worked, though.
(09-17-2015, 06:10 AM)xoft Wrote: [ -> ]I don't think this is even supposed to work. The SetName() method is only useful before the player is spawned for other players, which I think happens before the PLAYER_SPAWNED hook. SetCustomName() should have worked, though.
I'm check some time and some combinations and convinced that player not renamed "into" players list. But, other players see new player name after they (not renamed player) reconnect and any operations with player such us kick, kill, etc. work only with new player name.