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

Function

getPlayerAccount

ServerPlayersIdentical to MTA:SA

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