# getPlayerIP (Server)

> Returns the IP address the player is connected from, without the port.

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

## Syntax

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `player` | `player` | The player, or the console element. |

## Returns

The address, or `false` if it could not be read. For the console element, `"127.0.0.1"`.

## Example

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

## See also

- [getPlayerName (Server)](https://wiki.mymp.gg/en/getPlayerName.md): Returns the player's name. On a server with a server_key, it is the MYMP account name as Name#Tag.
- [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.
- [kickPlayer (Server)](https://wiki.mymp.gg/en/kickPlayer.md): Disconnects a player from the server with a reason.
