SetPlayerWorldBounds
描述
设置玩家的世界边界。玩家无法越出边界(越界时将被推回)。
名称 | 说明 |
---|---|
playerid | 要设置边界的玩家 ID |
Float:maxX | 玩家可到达的最大 X 坐标 |
Float:minX | 玩家可到达的最小 X 坐标 |
Float:maxY | 玩家可到达的最大 Y 坐标 |
Float:minY | 玩家可到达的最小 Y 坐标 |
返回值
本函数不返回任何特定值。
示例
public OnPlayerSpawn(playerid)
{
SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
return 1;
}
(北)
ymax
|----------|
| |
(西) xmin | | xmax (东)
| |
|----------|
ymin
(南)
注意
提示
可通过设置边界为 20000.0000, -20000.0000, 20000.0000, -20000.0000 来重置默认值,或使用 ClearPlayerWorldBounds。
注意
本函数在室内环境中无效!
相关函数
- ClearPlayerWorldBounds: 重置玩家的世界边界至默认值
- GetPlayerWorldBounds: 获取玩家的世界边界
- GangZoneCreate: 创建帮派区域