Player/GetName

From Garry's Mod
Jump to: navigation, search
 Player:GetName( )

Contents

Description

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

NOTE

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

string

The player's name.

BUG

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

Issue Tracker: #3178

Examples

Example

Prints the player's name

print( Entity(1):GetName() )

Output:

Ninja101
Personal tools
Navigation