ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getAccountData

Function

getAccountData

ServerAccountsIdentical to MTA:SA

Returns account data stored under a key. Account data is persistent: it stays after the player leaves and after a server restart.

Syntax

mixed getAccountData(account theAccount, string key)

Arguments

theAccountaccount
The account.
keystring
The key.

Returns

The value or false.

Example

addEventHandler("onPlayerLogin", root, function(_, account)
    setPlayerMoney(source, getAccountData(account, "money") or 0)
    local skin = getAccountData(account, "skin")
    if skin then setElementModel(source, skin) end
end)

See also