---
title: "UseGangZoneCheck | open.mp"
description: "callback رو وقتی بازیکن وارد/خارج این zone میشه فعال کن"
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/UseGangZoneCheck
language: fa
---

# UseGangZoneCheck

هشدار

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

## توضیحات

callback رو وقتی بازیکن وارد/خارج این zone میشه فعال می‌کنه.

| نام | توضیحات |
| --- | --- |
| zoneid | ID zone ای که می‌خوای تشخیص منطقه براش فعال کنی. |
| bool:enable | آیا تشخیص ورود باید شروع یا متوقف بشه؟ (`true`/`false`) |

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

**1:** تابع با موفقیت اجرا شد.

**0:** تابع اجرا نشد. gangzone مشخص شده وجود نداره.

## مثال‌ها

```c
new gGangZoneID = INVALID_GANG_ZONE;

public OnGameModeInit()
{
    gGangZoneID = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);

    // Enabled the callback when a player enters/leaves this zone
    // callback ro vaghti player vared/kharej in zone mishe faal kon
    UseGangZoneCheck(gGangZoneID, true);
}

public OnPlayerEnterGangZone(playerid, zoneid)
{
    if (zoneid == gGangZoneID)
    {
        new string[64];
        format(string, sizeof(string), "You are entering gangzone %i", zoneid);
        SendClientMessage(playerid, 0xFFFFFFFF, string);
    }
    return 1;
}

public OnPlayerLeaveGangZone(playerid, zoneid)
{
    if (zoneid == gGangZoneID)
    {
        new string[64];
        format(string, sizeof(string), "You are leaving gangzone %i", zoneid);
        SendClientMessage(playerid, 0xFFFFFFFF, string);
    }
    return 1;
}
```

## Callback های مرتبط

Callback های زیر ممکنه مفید باشن، چون به نحوی با این تابع مرتبط هستن.

-   [OnPlayerEnterGangZone](https://omp.itsneufox.com/fa/docs/scripting/callbacks/OnPlayerEnterGangZone): این callback وقتی بازیکن وارد gangzone میشه فراخوانی میشه.
-   [OnPlayerLeaveGangZone](https://omp.itsneufox.com/fa/docs/scripting/callbacks/OnPlayerLeaveGangZone): این callback وقتی بازیکن از gangzone خارج میشه فراخوانی میشه.

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

توابع زیر ممکنه مفید باشن، چون به نحوی با این تابع مرتبط هستن.

-   [GangZoneCreate](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneCreate): یک gangzone بساز.
-   [GangZoneDestroy](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneDestroy): یک gangzone رو نابود کن.
-   [GangZoneShowForPlayer](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneShowForPlayer): gangzone رو برای یک بازیکن نشون بده.
-   [GangZoneShowForAll](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneShowForAll): gangzone رو برای همه بازیکنا نشون بده.
-   [GangZoneHideForPlayer](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneHideForPlayer): gangzone رو برای یک بازیکن مخفی کن.
-   [GangZoneHideForAll](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneHideForAll): gangzone رو برای همه بازیکنا مخفی کن.
-   [GangZoneFlashForPlayer](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneFlashForPlayer): gangzone رو برای یک بازیکن چشمک بزن.
-   [GangZoneFlashForAll](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneFlashForAll): gangzone رو برای همه بازیکنا چشمک بزن.
-   [GangZoneStopFlashForPlayer](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneStopFlashForPlayer): چشمک زدن gangzone رو برای یک بازیکن متوقف کن.
-   [GangZoneStopFlashForAll](https://omp.itsneufox.com/fa/docs/scripting/functions/GangZoneStopFlashForAll): چشمک زدن gangzone رو برای همه بازیکنا متوقف کن.
-   [IsValidGangZone](https://omp.itsneufox.com/fa/docs/scripting/functions/IsValidGangZone): چک کن که آیا gangzone معتبر هست.
-   [IsPlayerInGangZone](https://omp.itsneufox.com/fa/docs/scripting/functions/IsPlayerInGangZone): چک کن که آیا بازیکن توی gangzone هست.
-   [IsGangZoneVisibleForPlayer](https://omp.itsneufox.com/fa/docs/scripting/functions/IsGangZoneVisibleForPlayer): چک کن که آیا gangzone برای بازیکن قابل مشاهده هست.
