Skip to content

Selectors

Axwabo edited this page Mar 2, 2025 · 5 revisions

Vanilla System

The base-game system uses player ID interpolation. IDs are separated by a . character, e.g. noclip 11.18.35 enable

This is especially difficult to use when having to execute a command not accessible from the Remote Admin GUI (e.g. addcandy).

Although the sequence can be copied by using the Request Data menu, it might be impractical.

Advanced Player Selectors

The base-game player selection system has been extended with Minecraft-like selectors. By patching the RAUtils.ProcessPlayerIdOrNamesList method, vanilla commands can also use this feature.

Important

The default configuration prevents this system from selecting the host player. If you want to be able to select the host, enable it in the config.

Basics

A simple way to select all players is by passing in the * character instead of the player ID list.

Example: forceclass 2.3.4.5.6 NtfSergeant forceclass * NtfSergeant

A substring of a player's nickname can also be passed in to search for (case-insensitive). Player IDs are have higher priority (if a number is provided and a player's name includes the value, a player with that ID is selected; if no ID match was found, it fails).

Other default selectors are prefixed with an @ symbol, followed by a single character.

Example: forceclass @s Scp173 where @s stands for "self".

Selector Char Description
a Selects all players like the * wildcard + can use filters
o All players except the sender
s Selects the command sender or self
r Random player; a limit can be specified (1 by default)

Filters

Advanced filters specify additional requirements for a player to be selected.

To add filters to a basic selector, use brackets [] and put the requirements between the pair. Conditions must be separated by , commas.

Important

If the filter sequence is not terminated by a ] character, no further arguments can be processed. This will not cause problems with commands that only take in a player list.

Multiple advanced selectors take in a value which is provided after an = character.

Filter names and values (except the ones marked with *) are trimmed: whitespaces are removed at the start and end of the string.

Filter names are case-insensitive (no distinction between UPPERCASE and lowercase letters).

Inverting a condition is simple: either place an ! before the requirement name, or before/after the = sign.

Examples:

  • @a[alive]
  • @r[role=FacilityGuard,!noclip]
  • @r[team!=SCPs , team=!classd]

Tip

By using the backslash \ symbol, you can escape characters to make them part of the filter name or value.

Example: @a[name=first\=second] will be interpreted that the name value is first=second

Ranges

Some filters allow the use of value ranges. These ranges can specify the minimum and/or maximum value. Two values must be separated by a double-dot .. sequence (start or end is optional).

Examples (player ID):

  • ..5 IDs 5 and below
  • 7.. IDs 7 and above
  • 12..26 IDs that are at least 12 and 26 at most
  • 8 a static value indicating that an exact match is required

Preset Filters

Name Aliases Value Type Player Condition
role r class c RoleTypeId range Role ID is in range
team Team range Team is in range
playerid pid int range RA ID is in range
nickname* nick name string ignore case Nickname contains the string
alive - Player is alive
ra remoteadmin - Access to the Remote Admin panel
stack onstack - On the sender's stack
curi currentitem ItemType range Currently held item is in range
godmode god - God mode is enabled
noclip nc - Noclip is permitted
health hp float range HP is in range
ahp artificalhealth float range AHP is in range
hs humeshield float range HS is in range (SCPs only)
distance dist float range Players of distance to self

Types

  • an int is a whole number (not a fraction), like 15 or 321
  • a float is a floating-point value, such as 0.1991 and is compatible with the value range: 0.1991..420
  • Enum Values contains the list of special values used by filters

Limit

The limit filter can specify the maximum amount of players to select. Only the random selector has a limit of 1 by default; others have no predefined limit.

You can specify the limit with a number, fraction or these keywords: all half quarter

The fractions and half and quarter are based on the server's player count, host excluded. For example, 2/3 on a server with 15 players would equal a limit of 10 players. If a fraction results in a floating-point value, the amount is ceiled: 2/3 of 16 will be 11.

Stack

The stack filter determines whether the target is present on any of the sender's selection stack lists.

A standalone stack selector also exists. By using the @stack selector, you can get the topmost player list on the stack.

If you'd like to specify the list index, you can do so by appending one of the following characters: :>_- (including whitespace) and the index.

The index may be a number (0 is topmost) or the following options:

  • first or f is the topmost value
  • last or l is the list first pushed onto the stack
  • all will combine every list on the stack

Finally, another built-in standalone selector is @spectated or @spec which selects the sender's current spectator target.

Clone this wiki locally