From Multi Theft Auto: Wiki
This event is triggered when a player disconnects from the server.
- quitType: How the player left.
This argument can be:
- "Bad Connection"
- "Timed out"
- reason: If the player was kicked or banned, the reason given goes here. If the player was not kicked or banned, this will be false.
- responsibleElement: The element that was responsible for kicking or banning the player. This is commonly another player, but can also be the console element.
This example gets the quitting client's name and outputs that he is gone
-- we register quitPlayer as a handler for the event function quitPlayer ( quitType ) -- we store the player's name local quittingPlayerName = getPlayerName ( source ) -- and send the message to the server outputChatBox ( quittingPlayerName .. " has left the server (" .. quitType .. ")" ) end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )