OnClientPlayerQuit: Difference between revisions
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
==Example== | ==Example== | ||
This | This example prints a message in server window when player leaves the server. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function onQuitGame( reason ) | function onQuitGame( reason ) |
Revision as of 22:38, 26 January 2008
This event is triggered when a remote player quits the game
Parameters
string reason
- reason: A string representing the reason why the player quit.
Quit reason string can be: - "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 server window when player leaves the server.
function onQuitGame( reason ) print( getPlayerName( getLocalPlayer() ).." 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