Skip to content

A3D_CreateZoneSphere

imshooter edited this page Oct 17, 2026 · 1 revision

Create a sphere shaped zone that reports moving physics objects entering and leaving it.

native Physic:A3D_CreateZoneSphere(Float:radius, Float:x, Float:y, Float:z, worldid = -1);

Parameters

Parameter Description Default
Float:radius Radius of the sphere.
Float:x Position on the X axis.
Float:y Position on the Y axis.
Float:z Position on the Z axis.
worldid Virtual world it watches, or -1 for every world. -1

Returns

  • The zone.
  • INVALID_PHYSIC_ID when the radius is not positive, or the world is full.

Remarks

The same as A3D_CreateZone with the shape of a sphere, which suits holes and pockets.

Example

Takes a ball off the table when it falls into a pocket.

static Physic:gPocket;

public OnGameModeInit() {
    gPocket = A3D_CreateZoneSphere(0.08, 1701.1, -2499.4, 13.4);

    return 1;
}

public A3D_OnEntered(Physic:zoneid, Physic:physicid) {
    if (zoneid != gPocket) {
        return 1;
    }

    A3D_DestroyObject(physicid);

    return 1;
}

Related

  • A3D_CreateZone: Create a box shaped zone that reports moving physics objects entering and leaving it.
  • A3D_OnEntered: A moving physics object entered a zone.
  • A3D_OnLeft: A moving physics object left a zone.

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