GetPlayerName: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetPlayerName(player)}} {{FuncParameters}} {{FuncParam|player|__EDIT_ME__}} {{FuncReturnValue|__E...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Client & Server|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Get a players Steam nickname/username.}}


{{FuncSyntax|GetPlayerName(player)}}
{{FuncSyntax|GetPlayerName(player)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|player|__EDIT_ME__}}
{{FuncParam|player|The player identifier.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns the Steam username as shown on their profile. Max length: 32. If [[SetPlayerName]] was called then it will return the value passed there.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddPlayerChat(k, '<span color="#fcc900" size="18">'..GetPlayerName(player).." ("..player..") finished the race at position "..Racers[player].finished_position..' in '..FinishTime..'</>')
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{ServerPlayerFunctions}}

Latest revision as of 20:52, 31 August 2020

GetPlayerName

Type: Function
Context: Client & Server
Introduced: v1.0

Description

Get a players Steam nickname/username.

Syntax

GetPlayerName(player)

Parameters

  • player
    The player identifier.

Return Value

  • Returns the Steam username as shown on their profile. Max length: 32. If SetPlayerName was called then it will return the value passed there.

Example

AddPlayerChat(k, '<span color="#fcc900" size="18">'..GetPlayerName(player).." ("..player..") finished the race at position "..Racers[player].finished_position..' in '..FinishTime..'</>')

See also