---
title: "TogglePlayerGhostMode | open.mp"
description: "حالت ghost بازیکن رو فعال/غیرفعال کن."
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/TogglePlayerGhostMode
language: fa
---

# TogglePlayerGhostMode

هشدار

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

## توضیحات

حالت ghost بازیکن رو فعال/غیرفعال می‌کنه. حالت Ghost برخورد بین مدل‌های بازیکن رو غیرفعال می‌کنه.

| نام | توضیحات |
| --- | --- |
| playerid | ID بازیکنی که می‌خوای حالت ghost ش رو فعال/غیرفعال کنی. |
| bool:toggle | true برای فعال کردن و false برای غیرفعال کردن. |

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

این تابع همیشه true برمی‌گردونه.

## مثال‌ها

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/ghostmode", true))
    {
        TogglePlayerGhostMode(playerid, true);
        SendClientMessage(playerid, -1, "SERVER: You enabled the ghost mode!");
        // SERVER: ghost mode ro faal kardi!
        return 1;
    }
    return 0;
}
```

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

-   [GetPlayerGhostMode](https://omp.itsneufox.com/fa/docs/scripting/functions/GetPlayerGhostMode): حالت ghost بازیکن رو بدست بیار.
