---
title: "GetPlayerPoolSize | open.mp"
description: "دریافت بالاترین playerid که در حال حاضر در سرور استفاده می‌شود."
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/GetPlayerPoolSize
language: fa
---

# GetPlayerPoolSize

هشدار

This function was added in SA-MP 0.3.7 and will not work in earlier versions!

## توضیحات

دریافت بالاترین playerid که در حال حاضر در سرور استفاده می‌شود. توجه کنید که در SA:MP این تابع خراب است و حتی زمانی که هیچ بازیکنی نیست `0` برمی‌گرداند. open.mp این را اصلاح می‌کنند تا `-1` برگرداند، اما همچنین این تابع را به نفع `MAX_PLAYERS` یا `foreach` منسوخ می‌کنند.

## مثال‌ها

```c
FreezeAll()
{
    // note that we assign the return value to a new variable (j) to avoid calling the function with each iteration
    for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
    {
        TogglePlayerControllable(i, 0);
    }
}
```

## توابع مرتبط

-   [GetVehiclePoolSize](https://omp.itsneufox.com/fa/docs/scripting/functions/GetVehiclePoolSize): دریافت بالاترین vehicleid که در حال حاضر در سرور استفاده می‌شود.
-   [GetMaxPlayers](https://omp.itsneufox.com/fa/docs/scripting/functions/GetMaxPlayers): دریافت حداکثر تعداد بازیکنان که می‌توانند به سرور بپیوندند.
