# getPlayerCount (Servidor)

> Devuelve cuántos jugadores hay en el servidor.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Servidor
- **Categoría**: Jugadores y cuentas
- **URL**: https://wiki.mymp.gg/es/getPlayerCount

## Sintaxis

```lua
int getPlayerCount()
```

## Retorno

El número de jugadores.

## Ejemplo

```lua
addEventHandler("onPlayerJoin", root, function()
    outputServerLog(getPlayerCount() .. " jugadores en línea")
end)
```

## Ver también

- [getPlayers (Servidor)](https://wiki.mymp.gg/es/getPlayers.md): Lista todos los jugadores del servidor.
- [getMaxPlayers (Servidor)](https://wiki.mymp.gg/es/getMaxPlayers.md): Devuelve cuántos jugadores acepta el servidor a la vez.
