---
title: "IsPlayerInPlayerGangZone | open.mp"
description: "验证玩家是否处于其绑定的玩家帮派区域"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsPlayerInPlayerGangZone
language: zh-CN
---

# IsPlayerInPlayerGangZone

注意

这个函数是在omp v1.1.0.2612中添加的，在以前的版本中不起作用！

## 描述

检测指定玩家是否处于其专属的玩家帮派区域范围内

| 参数名 | 说明 |
| --- | --- |
| playerid | 绑定该帮派区域的玩家 ID |
| zoneid | 玩家帮派区域标识符 |

## 返回值

**true** - 玩家处于专属帮派区域

**false** - 玩家未处于专属帮派区域

## 示例代码

```c
new gGangZoneID[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    // 创建玩家专属帮派区域
    gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/zone", true))
    {
        if (IsPlayerInPlayerGangZone(playerid, gGangZoneID[playerid]))
        {
            SendClientMessage(playerid, 0x00FF00FF, "你正处于专属帮派领地");
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000FF, "你未处于专属帮派领地");
        }
        return 1;
    }
    return 0;
}
```

## 相关函数

-   [CreatePlayerGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/CreatePlayerGangZone): 创建玩家专属帮派区域
-   [PlayerGangZoneDestroy](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneDestroy): 移除玩家专属帮派区域
-   [PlayerGangZoneShow](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneShow): 显示玩家专属帮派区域
-   [PlayerGangZoneHide](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneHide): 隐藏玩家专属帮派区域
-   [PlayerGangZoneFlash](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneFlash): 激活帮派区域闪烁效果
-   [PlayerGangZoneStopFlash](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneStopFlash): 停止帮派区域闪烁
-   [PlayerGangZoneGetFlashColour](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetFlashColour): 获取帮派区域闪烁颜色
-   [PlayerGangZoneGetColour](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetColour): 获取帮派区域基础颜色
-   [PlayerGangZoneGetPos](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetPos): 获取帮派区域坐标范围（minX, minY, maxX, maxY）
-   [IsValidPlayerGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsValidPlayerGangZone): 验证玩家帮派区域有效性
-   [IsPlayerGangZoneVisible](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsPlayerGangZoneVisible): 检测帮派区域可见状态
-   [IsPlayerGangZoneFlashing](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsPlayerGangZoneFlashing): 检测帮派区域闪烁状态
-   [UsePlayerGangZoneCheck](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/UsePlayerGangZoneCheck): 启用区域进出状态监测
