# getPlayerName (Servidor)

> Devolve o nome do jogador. Num servidor com `server_key`, é o nome da conta MYMP no formato `Nome#Tag`.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Servidor
- **Categoria**: Jogadores e contas
- **URL**: https://wiki.mymp.gg/pt/getPlayerName

## Sintaxe

```lua
string|false getPlayerName(player player)
```

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `player` | `player` | O jogador. |

## Retorno

O nome, ou `false` se o elemento não é um jogador.

## Exemplo

```lua
addEventHandler("onPlayerJoin", root, function()
    outputServerLog(getPlayerName(source) .. " joined")
end)
```

## Veja também

- [getPlayerFromName (Servidor)](https://wiki.mymp.gg/pt/getPlayerFromName.md): Encontra um jogador pelo nome exato, diferenciando maiúsculas e minúsculas.
- [getPlayerAccount (Servidor)](https://wiki.mymp.gg/pt/getPlayerAccount.md): Devolve a conta MYMP com que o jogador entrou.
