From 36337b4a48e793f4be94967a2560f5ca178083ea Mon Sep 17 00:00:00 2001 From: OciXCrom Date: Mon, 1 Jan 2018 15:18:38 +0100 Subject: [PATCH] Add 'j' and 'k' flags in get_user_flags for matching with admin flags --- amxmodx/amxmodx.cpp | 11 +++++++++++ plugins/include/amxmodx.inc | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index bfd7ee5e..d4fcac0d 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2248,6 +2248,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); @@ -2268,6 +2269,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) { @@ -2282,6 +2289,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/amxmodx.inc b/plugins/include/amxmodx.inc index e24059e6..cfd861ae 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -1387,11 +1387,13 @@ 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 string String to match against if the "e", "f", "j" or "k" flag is specified * * @noreturn */ -native get_players(players[MAX_PLAYERS], &num, const flags[] = "", const team[] = ""); +native get_players(players[MAX_PLAYERS], &num, const flags[] = "", const string[] = ""); /** * Retrieves argument of client command as string.