SlashCo Wiki

SlashCo.FindPlayersInRange

 table SlashCo.FindPlayersInRange( Vector origin, number radius, number specificTeam = nil, Entity or table ignoreEntity = nil )

Description

Finds all players in a given radius and checks if their visible from the origin by doing a trace.

Arguments

1Vector origin

The origin to check from

2number radius

The radius to check in

3number specificTeam = nil

A specific team to check for, an example would be TEAM_SURVIVOR
Can be left out / nil to check all players.

4Entity or table ignoreEntity = nil

If given, this is used as the trace filter to ignore specific entities.
See Garry's Mod Trace.filter documentation.

Returns

1table results

A sequential table containing all players that were found