onClientPlayerQuit | Multi Theft Auto: Wiki Skip to content

onClientPlayerQuit

Client-side
Server-side
Shared

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. (Use onClientResourceStop to save client side data when the local player quits.)

Parameters

string reason
  • reason: A string representing the reason why the player quit. "Unknown" "Quit" "Kicked" "Banned" "Bad Connection" "Timed out"

Source

element: The source of this event is the player that quit the game.

Code Examples

client

This example prints a message in the chatbox when a remote player leaves the server.

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

See Also