---
title: "SetPlayerWeather | open.mp"
description: "آب و هوای یک بازیکن رو تنظیم می‌کنه."
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/SetPlayerWeather
language: fa
---

# SetPlayerWeather

## توضیحات

آب و هوای یک بازیکن رو تنظیم می‌کنه.

| نام | توضیحات |
| --- | --- |
| playerid | ID بازیکنی که آب و هواش باید تنظیم بشه. |
| weather | [آب و هوا](https://omp.itsneufox.com/fa/docs/scripting/resources/weatherid) که باید تنظیم بشه. |

## مقدار برگشتی

این تابع هیچ مقدار خاصی برنمی‌گردونه.

## مثال‌ها

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/storm", true))
    {
        SetPlayerWeather(playerid, 8);
        return 1;
    }
    return 0;
}
```

## نکات

یادداشت

-   اگر [TogglePlayerClock](https://omp.itsneufox.com/fa/docs/scripting/functions/TogglePlayerClock) فعال باشه، آب و هوا آروم آروم طی زمان تغییر می‌کنه، نه اینکه فوری تغییر کنه.
-   فقط 21 ID آب و هوای معتبر در بازی وجود داره (0 - 20)، اما بازی هیچ نوع بررسی محدوده نداره.

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

-   [GetPlayerWeather](https://omp.itsneufox.com/fa/docs/scripting/functions/GetPlayerWeather): گرفتن آب و هوای یک بازیکن.
-   [SetWeather](https://omp.itsneufox.com/fa/docs/scripting/functions/SetWeather): تنظیم آب و هوای کلی.
-   [SetGravity](https://omp.itsneufox.com/fa/docs/scripting/functions/SetGravity): تنظیم جاذبه کلی.

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

-   [Weather IDs](https://omp.itsneufox.com/fa/docs/scripting/resources/weatherid)
