GetPlayerName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function returns a string containing the name of the specified player. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getPlayerName ( player ) | string getPlayerName ( player thePlayer ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | |||
=== | * '''thePlayer:''' The player you want to get the name of. | ||
*''' | |||
===Returns=== | ===Returns=== | ||
Returns a string containing the requested player's name, or ''false'' if the player passed to the function is invalid. | |||
==Example== | ==Example== | ||
This example outputs the local player name to the chatbox. | |||
This example | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | --we get the local player | ||
local localPlayer = getLocalPlayer() | |||
-- | --then we get his name | ||
local localPlayerName = getPlayerName(localPlayer) | |||
--and we output it to the chatbox | |||
outputChatBox(localPlayerName) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client player functions}} | |||
{{ | |||
Revision as of 00:04, 13 April 2007
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
This example outputs the local player name to the chatbox.
--we get the local player local localPlayer = getLocalPlayer() --then we get his name local localPlayerName = getPlayerName(localPlayer) --and we output it to the chatbox outputChatBox(localPlayerName)
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