Skip to content

GetPlayerName

The player’s name, as they joined.

Names are not unique: two players may join under one name, and their pids tell them apart (a mode that wants one player per name turns the second away in OnPlayerConnect). A name is 1-24 characters: Latin letters (the accented ones too) or Cyrillic letters - one alphabet per name, the first letter’s, so a name cannot mix look-alike letters of both - digits, spaces and _-.[](); anything else is left out when the player joins. The server takes a name from whoever types it and proves nothing: a mode that wants a name to belong to someone builds accounts on its database. nil when no player has the pid.

GetPlayerName(pid)
Parameter Type
pid number the player

string | nil

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

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