Skip to main content
Branch: Development

getEntitiesInDimension

Callable

  • getEntitiesInDimension(dimension: number, allowedTypes: BaseObjectFilterType): readonly Entity[]

  • Returns all entities of the specified type (or types) in the specified dimension.

    Example

    // Returns all players and vehicles in zero dimension
    const playersAndVehicles = alt.getEntitiesInDimension(
    0, // dimension
    alt.BaseObjectFilterType.Player | alt.BaseObjectFilterType.Vehicle,
    );

    // Returns only players in zero dimension
    const players = alt.getEntitiesInDimension(
    0, // dimension
    alt.BaseObjectFilterType.Player,
    );