M MY Multiplayer: Wiki
Side
Kind

getPlayerName

Server

Returns the player's name. On a server with a server_key, it is the MYMP account name as Name#Tag.

string|false getPlayerName(player player)

Parameters

NameTypeDescription
playerplayerThe player.

Returns

The name, or false if the element is not a player.

Example

addEventHandler("onPlayerJoin", root, function()
    outputServerLog(getPlayerName(source) .. " joined")
end)

See also