-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'j' and 'k' flags in get_players for matching with admin flags #476
base: master
Are you sure you want to change the base?
Conversation
@@ -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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add consts for all flags?
You should also update |
@rsKliPPy - I honestly didn't know that function even existed. Will do it tomorrow. |
It's alright, it's a fairly recent addition. |
@rsKliPPy - done. |
plugins/include/amxmodx.inc
Outdated
* | ||
* @noreturn | ||
*/ | ||
native get_players(players[MAX_PLAYERS], &num, const flags[] = "", const team[] = ""); | ||
native get_players(players[MAX_PLAYERS], &num, const flags[] = "", const string[] = ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't rename params like that. You will break backward compatibility. People can still explicit the param .team =
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to not update get_players
anyway. We should encourage the use of flags as a string. We don't need to keep the same functionalities, after all, get_players_ex
is an extended version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arkshine I changed the param name back to team
. I don't think however that get_players
shouldn't be updated. get_players_ex
is a stock that is depending on get_players
.
stock get_players_ex(players[MAX_PLAYERS], &num, GetPlayersFlags:flags = GetPlayers_None, const team[] = "")
{
new strFlags[12];
get_flags(_:flags, strFlags, charsmax(strFlags));
get_players(players, num, strFlags, team);
}
If we don't update get_players
, this change will have no effect.
It was fine to keep 'string' for |
@Arkshine In my opinion it was fine for Anyways, I'll change it back to |
What do you mean by |
@Arkshine I put back I meant that it won't have an effect because if the "e" flag isn't specified then it won't search for the team at all so most likely people won't do that. |
Arg name should also be fixed for |
"j" - match with all of the specified admin flags
"k" - match with any of the specified admin flags