OnClientChangeNick: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser32 (talk | contribs) No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | |||
function nickChangeHandler(oldNick, newNick) | |||
outputChatBox(oldNick.." is now known as "..newNick, getRootElement(), 255, 100, 100) -- display the message | |||
end | |||
addEventHandler("onPlayerChangeNick", getRootElement(), nickChangeHandler) -- add an event handler | |||
</syntaxhighlight> | |||
{{See also/Server event|Client events}} | {{See also/Server event|Client events}} |
Revision as of 18:54, 26 February 2012
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
The source of this event is the player that changed his nick
Example
function nickChangeHandler(oldNick, newNick) outputChatBox(oldNick.." is now known as "..newNick, getRootElement(), 255, 100, 100) -- display the message end addEventHandler("onPlayerChangeNick", getRootElement(), nickChangeHandler) -- add an event handler
See Also
Client events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled