diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index ac6d79dcce..2329ebf890 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2263,6 +2263,7 @@ static cell AMX_NATIVE_CALL get_players(AMX *amx, cell *params) /* 4 param */ { int iNum = 0; int ilen; + int pflags = 0; char* sptemp = get_amxstring(amx, params[3], 0, ilen); int flags = UTIL_ReadFlags(sptemp); @@ -2283,6 +2284,12 @@ static cell AMX_NATIVE_CALL get_players(AMX *amx, cell *params) /* 4 param */ team = g_teamsIds.findTeamIdCase(sptemp); } } + + if ((flags & 512) || (flags & 1024)) + { + sptemp = get_amxstring(amx, params[4], 0, ilen); + pflags = UTIL_ReadFlags(sptemp); + } for (int i = 1; i <= gpGlobals->maxClients; ++i) { @@ -2297,6 +2304,10 @@ static cell AMX_NATIVE_CALL get_players(AMX *amx, cell *params) /* 4 param */ continue; if ((flags & 128) && (pPlayer->pEdict->v.flags & FL_PROXY)) continue; + if ((flags & 512) && ((pPlayer->flags[0] & pflags) != pflags)) + continue; + if ((flags & 1024) && (!(pPlayer->flags[0] & pflags))) + continue; if (flags & 32) { if (flags & 64) diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc index ca5011ee6f..48ceec3225 100755 --- a/plugins/include/amxconst.inc +++ b/plugins/include/amxconst.inc @@ -493,7 +493,9 @@ enum GetPlayersFlags (<<= 1) GetPlayers_MatchNameSubstring, // Match with part of name GetPlayers_CaseInsensitive, // Match case insensitive GetPlayers_ExcludeHLTV, // Do not include HLTV proxies - GetPlayers_IncludeConnecting // Include connecting clients + GetPlayers_IncludeConnecting, // Include connecting clients + GetPlayers_MatchAllFlags, // Match with all of the specified admin flags + GetPlayers_MatchAnyFlags // Match with any of the specified admin flags }; /** diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 96fb92a84b..96fc4f2b14 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -859,15 +859,17 @@ stock set_task_ex(Float:time, const function[], id = 0, const any:parameter[] = * GetPlayers_CaseInsensitive - match case insensitive * GetPlayers_ExcludeHLTV - do not include HLTV proxies * GetPlayers_IncludeConnecting - include connecting clients - * @param team String to match against if the "e" or "f" flag is specified + * GetPlayers_MatchAllFlags - match with all of the specified admin flags + * GetPlayers_MatchAnyFlags - match with any of the specified admin flags + * @param string String to match against if a flag that demands additional information is specified * * @noreturn */ -stock get_players_ex(players[MAX_PLAYERS] = {}, &num, GetPlayersFlags:flags = GetPlayers_None, const team[] = "") +stock get_players_ex(players[MAX_PLAYERS] = {}, &num, GetPlayersFlags:flags = GetPlayers_None, const string[] = "") { - new strFlags[10]; + new strFlags[12]; get_flags(_:flags, strFlags, charsmax(strFlags)); - get_players(players, num, strFlags, team); + get_players(players, num, strFlags, string); } /** @@ -887,13 +889,15 @@ stock get_players_ex(players[MAX_PLAYERS] = {}, &num, GetPlayersFlags:flags = Ge * GetPlayers_CaseInsensitive - match case insensitive * GetPlayers_ExcludeHLTV - do not include HLTV proxies * GetPlayers_IncludeConnecting - include connecting clients - * @param team String to match against if the GetPlayers_MatchTeam or GetPlayers_MatchNameSubstring flag is specified + * GetPlayers_MatchAllFlags - match with all of the specified admin flags + * GetPlayers_MatchAnyFlags - match with any of the specified admin flags + * @param string String to match against if a flag that demands additional information is specified * * @return Number of clients on the server that match the specified flags */ -stock get_playersnum_ex(GetPlayersFlags:flags = GetPlayers_None, const team[] = "") +stock get_playersnum_ex(GetPlayersFlags:flags = GetPlayers_None, const string[] = "") { new PlayersNum; - get_players_ex(_, PlayersNum, flags, team); + get_players_ex(_, PlayersNum, flags, string); return PlayersNum; } diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index a60bd0ad2c..8325569c9c 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -1387,7 +1387,9 @@ native get_playersnum(flag = 0); * "g" - match case insensitive * "h" - do not include HLTV proxies * "i" - include connecting clients - * @param team String to match against if the "e" or "f" flag is specified + * "j" - match with all of the specified admin flags + * "k" - match with any of the specified admin flags + * @param team String to match against if the "e", "f", "j" or "k" flag is specified * * @noreturn */