onClientPlayerChangeNick | Multi Theft Auto: Wiki Skip to content

onClientPlayerChangeNick

Client-side
Server-side
Shared

This event is triggered when a player changes his nickname.

Parameters

string oldNick, string newNick
  • oldNick: the nickname the player had before.
  • newNick: the new nickname of the player.

Source

element: The source of this event is the player that changed his nick

Code Examples

client

This example snippet sends a lame message every time the local player changes his nick.

addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(),
function ( oldNick, newNick )
outputChatBox ( "Hi " .. oldNick .. "! Oh... You're not " .. oldNick .. " anymore, are you?", 0, 255, 0 )
outputChatBox ( "I like your new name, " .. newNick .. "!", 0, 255, 0 )
end
)

See Also