M MY Multiplayer: Wiki
Side
Kind

getPlayerAccount

Server

Returns the MYMP account the player joined with.

table|false getPlayerAccount(player player)

Parameters

NameTypeDescription
playerplayerThe player.

Returns

A table { id, name, tag }, or false if the player joined without an account (a server without a server_key).

Example

addEventHandler("onPlayerJoin", root, function()
    local account = getPlayerAccount(source)
    if account then
        outputServerLog(account.name .. "#" .. account.tag .. " joined (" .. account.id .. ")")
    end
end)

See also