getPlayerName | Multi Theft Auto: Wiki Skip to content

getPlayerName

Client-side
Server-side
Shared
Needs checking

This function was partially migrated from the old wiki. Please review manually:

  • Missing section: Limits

Pair: setPlayerName

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns a string containing the name of the specified player.

OOP Syntax Help! I don't understand this!

  • Method:player:getName(...)
  • Variable: .name

Syntax

string getPlayerName ( player thePlayer )
Required Arguments
  • thePlayer: the player you want to get the name of

Returns

  • string: value

Returns a string containing the requested player's name, or false if the player passed to the function is invalid.

Code Examples

shared
addCommandHandler("myname", function(ply)
outputChatBox("Your name: "..getPlayerName(ply), ply)
end)

See Also