---
title: "ArePlayerWeaponsAllowed | open.mp"
description: "检测玩家是否具有武器使用权限"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/ArePlayerWeaponsAllowed
language: zh-CN
---

# ArePlayerWeaponsAllowed

注意

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

## 描述

检测指定玩家是否被允许使用武器。

| 参数 | 说明 |
| --- | --- |
| playerid | 需要检测的玩家 ID |

## 返回值

**true** - 允许使用武器

**false** - 禁止使用武器

## 示例

```c
public OnPlayerSpawn(playerid)
{
    if (ArePlayerWeaponsAllowed(playerid))
    {
        // 执行武器相关操作
    }

    return 1;
}
```

## 相关函数

-   [AllowPlayerWeapons](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/AllowPlayerWeapons): 控制玩家武器权限开关
