use ProcessTargetString
eg
PHP Code:
if(args == 1) {
decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
// Process the targets
decl String:strTargetName[MAX_TARGET_LENGTH];
decl TargetList[MAXPLAYERS], TargetCount;
decl bool:TargetTranslate;
if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED,
strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
{
ReplyToTargetError(client, TargetCount);
return Plugin_Handled;
}
// Apply to all targets
for (new i = 0; i < TargetCount; i++)
{
new iClient = TargetList[i];
if (IsClientInGame(iClient) && !IsFakeClient(iClient)) {
}
}
}
__________________