# getPlayerPing (Server)

> Returns the player's ping to the server, as measured by the connection.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Players and accounts
- **URL**: https://wiki.mymp.gg/en/getPlayerPing-server
- **Counterpart**: Also exists on the client, with its own implementation: [getPlayerPing (Client)](https://wiki.mymp.gg/en/getPlayerPing-client.md)

## Syntax

```lua
int|false getPlayerPing(player player)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `player` | `player` | The player. |

## Returns

The ping in milliseconds, or `false` if the element is not a player.

## Example

```lua
setTimer(function()
    for _, player in ipairs(getPlayers()) do
        if getPlayerPing(player) > 500 then
            kickPlayer(player, "ping too high")
        end
    end
end, 10000, 0)
```

## See also

- [getPlayerPing (Client)](https://wiki.mymp.gg/en/getPlayerPing-client.md): Returns a player's ping. For the local player, it is this client's ping to the server; for the others, what the server reported about them.
- [getPlayerIP (Server)](https://wiki.mymp.gg/en/getPlayerIP.md): Returns the IP address the player is connected from, without the port.
- [kickPlayer (Server)](https://wiki.mymp.gg/en/kickPlayer.md): Disconnects a player from the server with a reason.
