Skip to content

A3D_CreateArea

imshooter edited this page Oct 17, 2026 · 1 revision

Create four walls around a rectangle on the ground.

stock bool:A3D_CreateArea(
    Float:minX,
    Float:minY,
    Float:maxX,
    Float:maxY,
    Float:minZ,
    Float:maxZ,
    Physic:walls[4],
    worldid = -1,
    Float:width = 0.2
)

Parameters

Parameter Description Default
Float:minX West edge.
Float:minY South edge.
Float:maxX East edge.
Float:maxY North edge.
Float:minZ Bottom of the walls.
Float:maxZ Top of the walls.
Physic:walls[4] The four walls created, south, north, west and east.
worldid Virtual world they collide in, or -1 for every world. -1
Float:width Thickness of each wall, outside the rectangle. 0.2

Returns

  • true when the four walls were created.
  • false when the rectangle is empty, or the world is full.

Remarks

A stock of the include that creates four static boxes with A3D_CreateStaticBox. The walls stand outside the rectangle, so the whole rectangle stays free inside. The south and north walls run past the corners by width, which closes the corners.

When a wall cannot be created, the walls already created are destroyed and the function returns false. Each wall is a static object of its own, destroyed with A3D_DestroyObject.

Example

Keeps the balls of a game inside a pitch.

static Physic:gPitch[4];

public OnGameModeInit() {
    if (!A3D_CreateArea(1680.0, -2520.0, 1720.0, -2480.0, 12.5, 15.5, gPitch)) {
        print("The pitch could not be walled.");
    }

    return 1;
}

public OnGameModeExit() {
    for (new i; i != sizeof (gPitch); ++i) {
        A3D_DestroyObject(gPitch[i]);
    }

    return 1;
}

Related

  • A3D_CreateStaticBox: Create an invisible box that never moves, such as a wall or a floor.
  • A3D_DestroyObject: Destroy a physics object, a static object or a zone, and the global object that shows it.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally