---
title: "ClearPlayerWorldBounds | open.mp"
description: "重置玩家的世界边界至默认状态"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/ClearPlayerWorldBounds
language: zh-CN
---

# ClearPlayerWorldBounds

注意

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

## 描述

将指定玩家的自定义世界边界恢复为系统默认设置

| 参数 | 说明 |
| --- | --- |
| playerid | 需要重置世界边界的玩家 ID |

## 返回值

**true** - 函数执行成功

**false** - 函数执行失败

## 示例代码

```c
public OnPlayerSpawn(playerid)
{
    SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
    ClearPlayerWorldBounds(playerid);
    return 1;
}
```

## 注意事项

技巧

系统默认边界值为 20000.0000, -20000.0000, 20000.0000, -20000.0000。建议使用此函数进行重置以确保代码可读性

## 相关函数

-   [SetPlayerWorldBounds](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetPlayerWorldBounds): 设置玩家活动范围边界（越界会被自动推回）
-   [GetPlayerWorldBounds](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GetPlayerWorldBounds): 获取玩家当前世界边界配置
