Garry's Mod Wiki

Player:GetName

string Player:GetName()

Description

Returns the player's name, this is an alias of Player:Nick.

This function overrides Entity:GetName (in the Lua metatable, not in c++), keep it in mind when dealing with ents.FindByName or any engine function which requires the mapping name.

Returns

1 string
The player's name.

This is limited to 31 characters even though Steam names can have 32.

Issue Tracker: 3178

Example

Prints the player's name

print( Entity( 1 ):GetName() )
Output: Player1

Page Links


Special Pages


Wikis

?

Render Time: 161ms

DB GetPage 93
Generate Html 3
SaveChanges (1) 49
Render Body 0
Render Sidebar 12