Repository navigation
A3D_GetActorsInSphere
imshooter edited this page Oct 17, 2026
·
1 revision
Find the actors within a distance of a point, nearest first.
native A3D_GetActorsInSphere(
Float:x,
Float:y,
Float:z,
Float:radius,
actors[],
size = sizeof (actors),
worldid = -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. | |
actors[] |
The actors found. | |
size |
Room in actors. |
sizeof (actors) |
worldid |
Virtual world of the actors, or -1 for any. |
-1 |
bool:sight |
Whether the centre must see them, with the map and static objects in the way. | false |
- The number of actors written.
Actors have no interior, so only the virtual world filters them. With sight, the line from the centre to the chest of each actor must be free of the map and of static objects. The actors are written nearest first.
The actors near a gunshot put their hands up.
public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) {
new
Float:x,
Float:y,
Float:z,
actors[16],
count
;
GetPlayerPos(playerid, x, y, z);
count = A3D_GetActorsInSphere(x, y, z, 15.0, actors, .worldid = GetPlayerVirtualWorld(playerid));
for (new i; i != count; ++i) {
ApplyActorAnimation(actors[i], "SHOP", "SHP_Rob_HandsUp", 4.1, false, true, true, true, 0);
}
return 1;
}- A3D_GetActorsInCone: Find the actors inside a cone, such as the view of a guard, nearest first.
- A3D_GetPlayersInSphere: Find the players within a distance of a point, nearest first.
3DAndreas 0.6.3 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions