OnClientPlayerQuit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (See Also for client player events)
Line 24: Line 24:
This page lacks an example
This page lacks an example
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here
function onQuitGame( reason )
    print( getPlayerName( getLocalPlayer() ).." has left the server ("..reason..")" )
end
addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame )
</syntaxhighlight>
</syntaxhighlight>



Revision as of 22:36, 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 page lacks an example

function onQuitGame( reason )
    print( getPlayerName( getLocalPlayer() ).." has left the server ("..reason..")" )
end
addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame )

See Also

Client player events


Client event functions