GetPlayerName

From Multi Theft Auto: Wiki
Revision as of 13:45, 27 March 2009 by Sebassje (talk | contribs) (server/client side)
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

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