Repository navigation
A3D_GetVehiclesInSphere
imshooter edited this page Oct 17, 2026
·
1 revision
Find the vehicles within a distance of a point, nearest first.
native A3D_GetVehiclesInSphere(
Float:x,
Float:y,
Float:z,
Float:radius,
vehicles[],
size = sizeof (vehicles),
worldid = -1,
interiorid = -1,
bool:sight = false
);| Parameter | Description | Default |
|---|---|---|
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. | |
vehicles[] |
The vehicles found. | |
size |
Room in vehicles. |
sizeof (vehicles) |
worldid |
Virtual world of the vehicles, or -1 for any. |
-1 |
interiorid |
Interior of the vehicles, or -1 for any. |
-1 |
bool:sight |
Whether the centre must see it, with the map and static objects in the way. | false |
- The number of vehicles written.
A vehicle is measured from its position, the centre of its model. With sight, the line from the centre to that position must be free of the map and of static objects. The vehicles are written nearest first.
A mechanic repairs every vehicle within ten metres.
stock RepairAround(playerid) {
new
Float:x,
Float:y,
Float:z,
vehicles[32],
count
;
GetPlayerPos(playerid, x, y, z);
count = A3D_GetVehiclesInSphere(x, y, z, 10.0, vehicles, .worldid = GetPlayerVirtualWorld(playerid));
for (new i; i != count; ++i) {
RepairVehicle(vehicles[i]);
}
}- A3D_GetPlayersInSphere: Find the players within a distance of a point, nearest first.
- A3D_GetVehicleOffsetPosition: Find where a point given relative to a vehicle lies in the world, as the vehicle stands and leans now.
- A3D_OverlapBox: Find everything a box overlaps, such as the room a vehicle or an object needs.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions