ObjectManager
@vimp-mp/types 2.0.1Manages object instances in this scripting context.
ts
interface ObjectManagerMembers
all
ts
readonly all: Array<GameObject>All currently alive objects.
create
ts
create(model: number, x: number, y: number, z: number, rx: number, ry: number, rz: number, extras?: ObjectCreateOptions): GameObject | nullCreate a world object. Rotation (rx, ry, rz) is in degrees. Returns the object handle, or null on failure.
destroy
ts
destroy(id: number): booleanDestroy an object by id. Prefer object.destroy() when you hold the instance — this is a convenience for callers that only have the id.
getById
ts
getById(id: number): GameObject | nullReturns the object with id, or null when it does not exist.