Skip to content

mapEdits.hide

Hides stock objects with the given GTA:SA model ID and interior whose origins fall within the radius. You can also turn off collision for those objects. Select a separate edit for a model’s low-detail copy when it has a different ID. The game restores affected objects when your gamemode stops or reloads.

mapEdits.hide(settings: ScriptMapEditSettings): Promise<ActionResult>
Name Type Description
settings ScriptMapEditSettings The stock objects to hide.

An ActionResult. The edit ID is in createdId. Invalid settings return invalid-model, invalid-position, invalid-radius, invalid-area, invalid-world or invalid-remove-collision. The gamemode can keep 128 edits active (map-edit-limit).

gamemodes/my-mode.ts
import { mapEdits, objects, type Vector3 } from "nativemp";
const position: Vector3 = [1750, -2490, 14];
const virtualWorld = 7;
const edit = await mapEdits.hide({ model: 1283, position, radius: 2, virtualWorld, removeCollision: true });
if (edit.status === "applied") {
const replacement = await objects.create({ model: 1337, position, virtualWorld });
if (replacement.status !== "applied" && edit.createdId !== undefined) await mapEdits.restore(edit.createdId);
}

The replacement appears only in virtual world 7. To give another world a different replacement, use that world’s ID in both calls and choose its replacement model.