---
title: "OnPlayerEnterGangZone | open.mp"
description: "当玩家进入帮派区域时触发此回调函数"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/callbacks/OnPlayerEnterGangZone
language: zh-CN
---

# OnPlayerEnterGangZone

注意

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

## 描述

当玩家进入帮派区域时触发此回调函数

| 参数 | 说明 |
| --- | --- |
| playerid | 进入帮派区域的玩家ID |
| zoneid | 玩家进入的帮派区域ID |

## 返回值

此回调始终在游戏模式中优先触发

## 示例

```c
public OnPlayerEnterGangZone(playerid, zoneid)
{
    new string[128];
    format(string, sizeof(string), "你正在进入帮派区域 %i", zoneid);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
```

## 相关回调

以下回调函数可能与此回调相关：

-   [OnPlayerLeaveGangZone](https://omp.itsneufox.com/zh-CN/docs/scripting/callbacks/OnPlayerLeaveGangZone): 当玩家离开帮派区域时触发

## 相关函数

以下函数可能与此回调函数相关：

-   [GangZoneCreate](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GangZoneCreate): 创建帮派区域（彩色雷达区域）
-   [GangZoneDestroy](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GangZoneDestroy): 销毁帮派区域
-   [UseGangZoneCheck](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/UseGangZoneCheck): 启用玩家进入该区域时的回调检测
