GetPlayerName

From GT-MP
Jump to: navigation, search
GetPlayerName
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

Returns the given player's name.


Syntax

API.getPlayerName(Client player);

Required Arguments

  • player: parameter input should be in Client type.

NOTE: This function returns data in string type.


Usage example(s)

/whoami command that shows your name:

In C#
Server-Side Function

[Command("whoami")]
public void CMD_WhoAmI(Client player)
{
    API.sendChatMessageToPlayer(player, "Your name is: " + API.getPlayerName(player));
}

References