Skip to content

GetPlayerName

The player’s name, as they joined.

Names are unique on a server and compared case-insensitively; a registered name (IsPlayerRegistered) belongs to whoever logs in with its password. nil when no player has the pid.

GetPlayerName(pid)
Parameter Type
pid number the player

string | nil

SendClientMessageToAll(COLOUR_SERVER, GetPlayerName(pid) .. " has arrived")
-- the other way round, a name (or a fragment of one) to a pid: GetPlayerId

GetPlayerId · GetPlayers · IsPlayerConnected · SetPlayerNameplate · the Players group of the index