GetPlayerName
Jump to navigation
Jump to search
This function returns a string containing the name of the specified player.
Syntax
string getPlayerName ( player thePlayer )
Required Arguments
- thePlayer: The player you want to get the name of.
Returns
Returns a string containing the requested player's name, or false if the player passed to the function is invalid.
Example
Click to collapse [-]
ServeraddCommandHandler("myname", function(playerSource) outputChatBox("Your name: "..getPlayerName(playerSource), playerSource) end )
<section name="Client" class="client" show="true"> This example outputs the local player name to the chatbox.
addCommandHandler("myname", function() local localPlayerName = getPlayerName(getLocalPlayer()) --and we output it to the chatbox outputChatBox(localPlayerName) end )
<section>
See Also
- getLocalPlayer
- getPlayerMapBoundingBox
- getPlayerMapOpacity
- isPlayerMapVisible
- resetBlurLevel
- isPlayerHudComponentVisible
- Shared
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState