SlashCo Wiki

Player:FindPlayersInView

  table Player:FindPlayersInView( number distance, number radius, bool notrace = false )

Description

Finds all players in a cone from our player's view and doing traces to filter for players obstructed by objects.
For slashers this respects the value of Player:GetCanSeePlayers returning an empty table if thir blind

Arguments

1number distance
Maximum distance to check for
2number radius

A bit more complex as this value is given to ents.FindInCone as the angle_cos argument.
See the Garry's Mod wiki to know how to use it.

3bool notrace = false
If set, the function won't do traces to verify if a player is visible

Returns

1table result
A sequential table containing all found players