OnClientPlayerChangeNick: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(14 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{Client event}} | |||
__NOTOC__ | __NOTOC__ | ||
This event is | This event is triggered when a player changes his nickname. | ||
== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string oldNick, string newNick | |||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''oldNick:''' the nickname the player had before. | |||
*'''newNick:''' the new nickname of the player. | |||
==Source== | |||
The [[event system#Event source|source]] of this event is the player that changed his nick | |||
==Example== | ==Example== | ||
This example | This example snippet sends a lame message every time the local player changes his nick. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
===Client player events=== | |||
{{Client_player_events}} | |||
===Client event functions=== | |||
{{Client_event_functions}} |
Latest revision as of 01:06, 29 September 2019
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
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
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled