# getPlayerIdentifier (Server)

> Returns one of the player's identifiers of a type, such as `steam` or `discord`.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Players and accounts
- **URL**: https://wiki.mymp.gg/en/getPlayerIdentifier

## Syntax

```lua
string|false getPlayerIdentifier(player player, string type)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `player` | `player` | The player. |
| `type` | `string` | The identifier's type, without the colon: `steam` or `discord`. |

## Returns

The identifier with its prefix, such as `steam:110000112345678`, or `false` if the player has none of that type.

## Example

```lua
addEventHandler("onPlayerJoin", root, function()
    local steam = getPlayerIdentifier(source, "steam")
    outputServerLog(getPlayerName(source) .. " steam: " .. tostring(steam))
end)
```

### Note

The `discord` one comes from the player's Discord app and is not verified. The `steam` one is only verified when the server has a `steam_api_key`.

## See also

- [getPlayerIdentifiers (Server)](https://wiki.mymp.gg/en/getPlayerIdentifiers.md): Lists all of the player's identifiers, each as type:value, for example steam:110000112345678 and discord:80351110224678912.
- [getPlayerAccount (Server)](https://wiki.mymp.gg/en/getPlayerAccount.md): Returns the MYMP account the player joined with.
