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

Event

onPlayerLogin

ServerAccountsIdentical to MTA:SA

A player logged in to a server account (logIn).

Handler

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

Parameters

thePreviousAccountaccount
Previous account (guest).
theCurrentAccountaccount
New account.

Source

source is the player.

cancelEvent() blocks the login.

Example

addEventHandler("onPlayerLogin", root, function(_, account)
    setPlayerMoney(source, tonumber(getAccountData(account, "pieniadze")) or 0)
end)

See also