Repository navigation
A3D_GetPlayersOnScreen
imshooter edited this page Oct 17, 2026
·
1 revision
Find the players on the screen of a player, nearest first, in the same virtual world and interior.
A player is measured at the height of the chest.
native A3D_GetPlayersOnScreen(
playerid,
players[],
size = sizeof (players),
bool:sight = false,
Float:range = 300.0
);| Parameter | Description | Default |
|---|---|---|
playerid |
Player whose screen it is. | |
players[] |
The players found. | |
size |
Room in players. |
sizeof (players) |
bool:sight |
Whether the camera must see them, with the map and static objects in the way. | false |
Float:range |
How far from the camera to look. | 300.0 |
- The number of players written.
A player shows when their chest lies on the screen, within range of the camera, in the same virtual world and interior. The viewer is left out, and so are players who are not spawned, are dead or spectate. With sight, players behind the map or a static object are left out too. The players are written nearest to the camera first.
Shows the enemies a player sees on the radar of that player only.
stock SpotEnemies(playerid) {
new
players[MAX_PLAYERS],
count = A3D_GetPlayersOnScreen(playerid, players, .sight = true, .range = 150.0)
;
for (new i; i != count; ++i) {
if (GetPlayerTeam(players[i]) == GetPlayerTeam(playerid)) {
continue;
}
SetPlayerMarkerForPlayer(playerid, players[i], 0xFF0000FF);
}
}- A3D_GetVehiclesOnScreen: Find the vehicles on the screen of a player, nearest first, in the same virtual world and interior, leaving out the one they are in.
- A3D_GetActorsOnScreen: Find the actors on the screen of a player, nearest first, in the same virtual world.
- 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