FindTargetEx:
PHP Code:
int FindTargetEx(int client, const char[] target, int flags = 0)
{
char target_name[MAX_TARGET_LENGTH];
int target_list[1], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString(target, client, target_list, sizeof(target_list), COMMAND_FILTER_NO_MULTI | flags, target_name, sizeof(target_name), tn_is_ml)) > 0)
{
return target_list[0];
}
ReplyToTargetError(client, target_count);
return -1;
}
ReplyToCommandSource:
PHP Code:
void ReplyToCommandSource(int client, ReplySource commandSource, const char[] format, any ...)
{
char buffer[254];
SetGlobalTransTarget(client);
VFormat(buffer, sizeof(buffer), format, 4);
ReplySource currentSource = SetCmdReplySource(commandSource);
ReplyToCommand(client, buffer);
SetCmdReplySource(currentSource);
}
ConvertSteamIdIntoAccountId:
PHP Code:
int ConvertSteamIdIntoAccountId(const char[] steamId)
{
Regex exp = new Regex("^STEAM_[0-5]:[0-1]:[0-9]+$");
int matches = exp.Match(steamId);
delete exp;
if (matches != 1)
{
return 0;
}
return StringToInt(steamId[10]) * 2 + (steamId[8] - 48);
}
__________________