FindTarget

Last Updated2020-01-14
Created At2007-07-26

Wraps ProcessTargetString() and handles producing error messages for bad targets. Note that you should use LoadTranslations("common.phrases") in OnPluginStart(). "common.phrases" contains all of the translatable phrases that FindTarget() will reply with in the event a target is not found (error).

stock int FindTarget(int client, const char[] target, bool nobots = false, bool immunity = true)

Parameters

int client
Client who issued command
const char[] target
Client's target argument
bool nobots
Optional. Set to true if bots should NOT be targetted
bool immunity
Optional. Set to false to ignore target immunity.

Return Value

int Index of target client, or -1 on error.