Class Target
- Namespace
- CounterStrikeSharp.API.Modules.Commands.Targeting
- Assembly
- CounterStrikeSharp.API.dll
public class Target
- Inheritance
-
objectTarget
Constructors
Target(string)
public Target(string target)
Parameters
targetstring
Fields
TargetTypeMap
public static readonly IReadOnlyDictionary<string, TargetType> TargetTypeMap
Field Value
Methods
FindTarget(CCSPlayerController, string, bool, bool)
Wraps ProcessTargetString() and handles producing error messages for bad targets.
public static CCSPlayerController? FindTarget(CCSPlayerController player, string targetString, bool nobots = false, bool immunity = true)
Parameters
playerCCSPlayerControllerThe player who executed the command.
targetStringstringThe target string (e.g., player name, #userid, @all).
nobotsboolOptional. Set to true if bots should NOT be targetted
immunityboolOptional. Set to false to ignore target immunity.
Returns
GetTarget(CCSPlayerController?)
public TargetResult GetTarget(CCSPlayerController? caller)
Parameters
callerCCSPlayerController
Returns
ProcessTargetString(CCSPlayerController?, string, ProcessTargetFilterFlag, bool, out string, out List<CCSPlayerController>)
Processes a target string, finds matching players, and applies specified filters.
public static ProcessTargetResultFlag ProcessTargetString(CCSPlayerController? player, string targetString, ProcessTargetFilterFlag filter, bool tnIsMl, out string targetname, out List<CCSPlayerController> players)
Parameters
playerCCSPlayerControllerThe player who executed the command.
targetStringstringThe target string (e.g., player name, #userid, @all).
filterProcessTargetFilterFlagFlags to filter the found targets.
tnIsMlboolIf true, the target name buffer will be an ML phrase. Otherwise, it will be normal string.
targetnamestringAn output list that will contain the resolved target names. These may be localization keys (e.g., "all", "ct") if
tnIsMlis true, or actual player names otherwise.playersList<CCSPlayerController>An output list that will be populated with the player entities matching the target string.
Returns
ReplyToTargetError(CCSPlayerController, ProcessTargetResultFlag)
Replies to a client with a given message describing a targetting failure reason.
public static void ReplyToTargetError(CCSPlayerController player, ProcessTargetResultFlag resultFlag)
Parameters
playerCCSPlayerControllerThe player who executed the command.
resultFlagProcessTargetResultFlagThe ProcessTargetResultFlag value indicating why it is failed.