ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPlayerChangeNick

Event

onPlayerChangeNick

A player changed their nick (e.g. setPlayerName).

Handler

addEventHandler("onPlayerChangeNick", root, function(oldNick, newNick) ... end)

Parameters

oldNickstring
Old nick.
newNickstring
New nick.

Differences from MTA:SA

  • These MTA:SA parameters are not here: bool changedByUser

In MTA:SA

function(string oldNick, string newNick, bool changedByUser)

Source

source is the player.

Example

addEventHandler("onPlayerChangeNick", root, function(old, new)
    outputChatBox(old .. " to teraz " .. new, root)
end)

See also