OnClientPlayerQuit: Difference between revisions
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function onQuitGame( reason ) | function onQuitGame( reason ) | ||
outputChatBox ( | outputChatBox ( " MOJRM-511 has left the server ("..reason..")" ) | ||
end | end | ||
addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame ) | addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame ) |
Revision as of 23:26, 1 June 2013
This event is triggered when a remote player quits the game or leaves the server. It will not get triggered on the source player's client.
Parameters
string reason
- reason: A string representing the reason why the player quit.
- "Unknown"
- "Quit"
- "Kicked"
- "Banned"
- "Bad Connection"
- "Timed out"
Source
The source of this event is the player that quit the game.
Example
This example prints a message in the chatbox when a remote player leaves the server.
function onQuitGame( reason ) outputChatBox ( " MOJRM-511 has left the server ("..reason..")" ) end addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame )
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