ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPlayerQuit

Event

onPlayerQuit

A player left the server. The player element still exists, so you can save their data. Reasons are in Polish, e.g. "rozlaczony" (disconnected) or "przekroczony czas oczekiwania" (timed out).

Handler

addEventHandler("onPlayerQuit", root, function(reason) ... end)

Parameters

reasonstring
Reason for leaving.

Differences from MTA:SA

  • These MTA:SA parameters are not here: string reason, element responsibleElement

In MTA:SA

function(string quitType, string reason, element responsibleElement)

Source

source is the player.

Example

addEventHandler("onPlayerQuit", root, function(reason)
    outputChatBox(getPlayerName(source) .. " wyszedł (" .. reason .. ").", root)
end)

Notes

Reasons in Polish. There is no "Quit", "Kicked" or "Timed out"; compare with the server's Polish strings.

See also