ProcessTargetString Function

Processes a generic command target string, and resolves it to a list of clients or one client, based on filtering rules and a pattern.

Note that you should use LoadTranslations("common.phrases") in OnPluginStart(), as that file is guaranteed to contain all of the translatable phrases that ProcessTargetString() will return.

int ProcessTargetString(const char[] pattern, int admin, int[] targets, int max_targets, int filter_flags, char[] target_name, int tn_maxlength, bool &tn_is_ml)

Parameters

const char[] pattern

Pattern to find clients against.

int admin

Admin performing the action, or 0 if the server.

int[] targets

Array to hold targets.

int max_targets

Maximum size of the targets array.

int filter_flags

Filter flags.

char[] target_name

Buffer to store the target name.

int tn_maxlength

Maximum length of the target name buffer.

bool& tn_is_ml

OUTPUT: Will be true if the target name buffer is an ML phrase, false if it is a normal string.

Return Value

If a multi-target pattern was used, the number of clients found is returned. If a single-target pattern was used, 1 is returned if one valid client is found. Otherwise, a COMMAND_TARGET reason for failure is returned.