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

Event

onPlayerLogout

ServerAccountsIdentical to MTA:SA

A player logged out of an account.

Handler

addEventHandler("onPlayerLogout", root, function(thePreviousAccount, theCurrentAccount) ... end)

Parameters

thePreviousAccountaccount
The account they left.
theCurrentAccountaccount
The guest account.

Source

source is the player.

cancelEvent() blocks the logout.

Example

addEventHandler("onPlayerLogout", root, function(account)
    setAccountData(account, "pieniadze", getPlayerMoney(source))
end)

See also