Skip to content

A3D_RemoveBuilding

imshooter edited this page Oct 17, 2026 · 1 revision

Remove the map objects of a model around a point, as RemoveBuildingForPlayer does for what players see.

A removal may hold for one virtual world only. Physics objects resting on a removed map object wake up and fall.

native A3D_RemoveBuilding(modelid, Float:x, Float:y, Float:z, Float:radius, worldid = -1);

Parameters

Parameter Description Default
modelid Model to remove, or -1 for every model.
Float:x Centre on the X axis.
Float:y Centre on the Y axis.
Float:z Centre on the Z axis.
Float:radius Distance from the centre to the position of the map objects.
worldid Virtual world they are removed in, or -1 for every world. -1

Returns

  • The number of map objects removed.

Remarks

Every map object whose position lies within radius of the centre is removed, of the model given or of any model with -1. The return value counts the ones removed by this call, so a map object already removed is not counted again.

  • With worldid set to -1, the map objects leave every world.
  • With a virtual world, only the bodies and queries of that world miss them. Call it once for each world that needs the removal.

Removals work at any time, also while players are in game. Physics objects resting on a removed map object wake up and fall.

The game still shows the building and collides players with it until RemoveBuildingForPlayer removes it for them, so call both. A call scans the 39,000 map objects of the game and costs about 0.2 milliseconds.

Example

Clears the lamp posts of a square for a stage, for physics and for players.

public OnGameModeInit() {
    A3D_RemoveBuilding(1226, 1700.0, -2500.0, 13.0, 30.0);

    return 1;
}

public OnPlayerConnect(playerid) {
    RemoveBuildingForPlayer(playerid, 1226, 1700.0, -2500.0, 13.0, 30.0);

    return 1;
}

Related

  • A3D_RestoreBuilding: Bring back map objects removed by A3D_RemoveBuilding.
  • A3D_IsPointInsideMap: Whether a point lies inside the collision of the map, such as a player who fell under the ground or into a closed model.
  • A3D_CreateStaticObject: Create a physics object that never moves, shaped like the collision of a model.

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