---
title: "PlayerGangZoneDestroy | open.mp"
description: "销毁玩家专属帮派区域"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneDestroy
language: zh-CN
---

# PlayerGangZoneDestroy

注意

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

## 描述

用于销毁指定玩家的专属帮派区域

| 参数 | 说明 |
| --- | --- |
| playerid | 目标玩家的 ID |
| zoneid | 要销毁的帮派区域 ID |

## 返回值

**1:** 操作成功执行

**0:** 执行失败（指定帮派区域不存在）

## 示例

```c
// 全局变量存储帮派区域ID
new gGangZoneID[MAX_PLAYERS] = {INVALID_GANG_ZONE, ...};

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

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    // 检测帮派区域有效性后执行销毁
    if (IsValidPlayerGangZone(playerid, gGangZoneID[playerid]))
    {
        PlayerGangZoneDestroy(playerid, gGangZoneID[playerid]);
        gGangZoneID[playerid] = INVALID_GANG_ZONE; // 重置区域标识
    }
    return 1;
}
```

## 相关函数

-   [CreatePlayerGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/CreatePlayerGangZone): 创建玩家专属帮派区域
-   [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): 停止区域闪烁
-   [PlayerGangZoneGetColour](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetColour): 获取区域基础颜色
-   [PlayerGangZoneGetFlashColour](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetFlashColour): 获取区域闪烁颜色
-   [PlayerGangZoneGetPos](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/PlayerGangZoneGetPos): 获取区域坐标范围（最小 X/Y，最大 X/Y）
-   [IsValidPlayerGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsValidPlayerGangZone): 验证区域有效性
-   [IsPlayerInPlayerGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsPlayerInPlayerGangZone): 检测玩家是否在区域内
-   [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): 启用区域进出回调检测
