ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. removeWorldModel

Function

removeWorldModel

Server and clientWorldIdentical to MTA:SA

Stores the removal of San Andreas map objects with a given model within a sphere of the given radius. Can be called many times; each call adds an entry. If called before the game has loaded its models (e.g. while the player joins), it waits and applies once loading finishes.

Syntax

bool removeWorldModel(int model, float radius, float x, float y, float z [, int interior = -1])

Arguments

modelint
Map object model number.
radiusfloat
Radius in metres.
xfloat
Centre X.
yfloat
Centre Y.
zfloat
Centre Z.
interiorint, optional = -1
Interior where the removal applies (-1 = any).

Returns

true on success.

Example

removeWorldModel(1226, 20, 2495, -1665, 13)

Notes

Collision included. Map buildings and objects disappear for every player together with their collision: you can walk, drive and shoot through them. Buildings streamed in later disappear too. <removeWorldObject> entries from .map files work the same way.

Props without a name. Some props added in the DE version have a model number with no name in the game's table (e.g. 6, 266, 329; processLineOfSight returns such a number). They can be removed with that number too: props of that model inside the given sphere disappear.

Poles, fences, graffiti. Objects the game keeps as separate level actors (telegraph poles, dyn_mesh fences, graffiti, gas pumps, plants) disappear just like buildings and do not come back after a moment. Props with a numbered model and no name (e.g. barrels, cabinets and shelves in warehouses) disappear together with the level decorations standing inside their outline. Models without collision (graffiti, car wash brushes) can be picked with the cursor using getWorldModelOnLine.

Several resources. When two resources remove the same building, stopping one of them does not bring it back. restoreWorldModel removes the calling resource's own entries first. This works the same on the server and on the client: a removal made by a client script stays when another resource (e.g. the map editor) restores the same model at that spot.

See also