Repository navigation
A3D_GetActorsInCone
imshooter edited this page Oct 17, 2026
·
1 revision
Find the actors inside a cone, such as the view of a guard, nearest first.
An actor is measured at the height of the chest.
native A3D_GetActorsInCone(
Float:x,
Float:y,
Float:z,
Float:directionX,
Float:directionY,
Float:directionZ,
Float:angle,
Float:range,
actors[],
size = sizeof (actors),
worldid = -1,
bool:sight = false
);| Parameter | Description | Default |
|---|---|---|
Float:x |
Apex of the cone on the X axis. | |
Float:y |
Apex on the Y axis. | |
Float:z |
Apex on the Z axis. | |
Float:directionX |
Direction of the cone on the X axis. | |
Float:directionY |
Direction on the Y axis. | |
Float:directionZ |
Direction on the Z axis. | |
Float:angle |
Angle between the direction and the side of the cone, in degrees. | |
Float:range |
Length of the cone. | |
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 apex must see them, with the map and static objects in the way. | false |
- The number of actors written.
The cone works as in A3D_GetPlayersInCone, measured at the chest of each actor.
Tells whether a player stands in front of a shopkeeper, from the point of view of the player.
stock bool:IsFacingShopkeeper(playerid, actorid) {
new
Float:x,
Float:y,
Float:z,
Float:angle,
actors[4],
count
;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
count = A3D_GetActorsInCone(x, y, z + 0.5, -floatsin(angle, degrees), floatcos(angle, degrees), 0.0, 30.0, 4.0, actors, .worldid = GetPlayerVirtualWorld(playerid), .sight = true);
for (new i; i != count; ++i) {
if (actors[i] == actorid) {
return true;
}
}
return false;
}- A3D_GetActorsInSphere: Find the actors within a distance of a point, nearest first.
- A3D_GetPlayersInCone: Find the players inside a cone, such as the view of a guard or the spread of a shotgun, nearest first.
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