---
title: "AllowNickNameCharacter | open.mp"
description: "允许或禁止特定字符在玩家昵称中使用"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/AllowNickNameCharacter
language: zh-CN
---

# AllowNickNameCharacter

注意

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

## 描述

控制是否允许特定字符出现在玩家昵称中。

| 参数 | 说明 |
| --- | --- |
| character | 需要控制的 ASCII 字符 |
| bool:allow | true-允许使用，false-禁止使用 |

## 返回值

此函数不返回特定值。

## 示例

```c
public OnGameModeInit()
{
    AllowNickNameCharacter('*', true);  // 允许星号字符
    AllowNickNameCharacter('[', false); // 禁止左方括号
    AllowNickNameCharacter(']', false); // 禁止右方括号

    return 1;
}
```

## 相关函数

-   [IsNickNameCharacterAllowed](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsNickNameCharacterAllowed): 检测指定字符是否允许在昵称中使用
-   [IsValidNickName](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/IsValidNickName): 验证昵称格式是否合法
-   [SetPlayerName](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetPlayerName): 设置玩家昵称
-   [GetPlayerName](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GetPlayerName): 获取玩家昵称
