getPlayerNametagText | Multi Theft Auto: Wiki Skip to content

getPlayerNametagText

Client-side
Server-side
Shared

Pair: setPlayerNametagText

Manual Review Required

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


This will allow you to retrieve the name tag a player is currently using.

OOP Syntax Help! I don't understand this!

  • Method:player:getNametagText(...)
  • Variable: .nametagText

Syntax

string getPlayerNametagText ( player thePlayer )
Required Arguments
  • thePlayer: The person whose name tag you want to retrieve

Returns

  • string: value

Returns a string with the nametag text, false if the player is invalid.

Code Examples

shared

This will output the nametag text of the player who enters the command 'myNametag'.

function showNametag ( thePlayer, command )
local nameTag = getPlayerNametagText ( thePlayer )
outputChatBox ( "Your nametag text is: " .. nameTag, thePlayer )
end
addCommandHandler("myNametag", showNametag)

See Also