- Documentation
- Server functions
- getPlayerAccount
Function
getPlayerAccount
Returns the player's account. When the player is not logged in, it returns a guest account.
Syntax
account getPlayerAccount(player thePlayer)Arguments
thePlayerplayer- The player.
Returns
The account.
Example
addCommandHandler("konto", function(player)
local acc = getPlayerAccount(player)
if isGuestAccount(acc) then
outputChatBox("Nie jesteś zalogowany.", player)
else
outputChatBox("Konto: " .. getAccountName(acc), player)
end
end)
See also
isGuestAccountChecks whether the account is a guest account, i.e. the player is not logged in.logInLogs a player into an account. FiresonPlayerLogin. An account can be logged in by only one player at a time.getAccountDataReturns account data stored under a key. Account data is persistent: it stays after the player leaves and after a server restart.