- Documentation
- Server functions
- setAccountData
Function
setAccountData
Stores account data under a key. The value is kept permanently (also after a server restart).
Syntax
bool setAccountData(account theAccount, string key, mixed value)Arguments
theAccountaccount- The account.
keystring- The key.
valuemixed- The value: number, string,
true/false, table.
Returns
true on success.
Example
addEventHandler("onPlayerQuit", root, function()
local account = getPlayerAccount(source)
if not isGuestAccount(account) then
setAccountData(account, "money", getPlayerMoney(source))
setAccountData(account, "skin", getElementModel(source))
end
end)