GetPlayerName: Difference between revisions
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
* '''thePlayer:''' | * '''thePlayer:''' the Player that you want to get his name | ||
===Returns=== | ===Returns=== |
Revision as of 20:26, 17 October 2012
This function returns a string containing the name of the specified player.
Syntax
string getPlayerName ( player thePlayer )
Required Arguments
- thePlayer: the Player that you want to get his name
Returns
Returns a string containing the requested player's name, or false if the player passed to the function is invalid.
Limits
- Player name can consist of ASCII characters between 33 and 126 are allowed (basic latin):
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
- Minimal player name length is 1 character.
- Maximum player name length is 22 characters.
- Player names are case-insensitive. It is not possible to have two clients with same name but different character case.
Example
Click to collapse [-]
ServeraddCommandHandler("myname", function(playerSource) outputChatBox("Your name: "..getPlayerName(playerSource), playerSource) end )
Click to collapse [-]
ClientThis 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 )
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