AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   [Suggestion] get_players flags (https://forums.alliedmods.net/showthread.php?t=303875)

^SmileY 12-25-2017 19:40

[Suggestion] get_players flags
 
Is possible to include a flag in get_players() native to also return number of players in both teams?

Something like else get_players(players, num "j") // return players in both teams excluding Specs ?

Ps. it will avoid to use double get_players to get count of both teams or a loop that check this??

DjSoftero 12-26-2017 04:49

Re: [Suggestion] get_players flags
 
use get_players() twice

^SmileY 12-26-2017 07:05

Re: [Suggestion] get_players flags
 
Quote:

Originally Posted by DjSoftero (Post 2568182)
use get_players() twice

Did you read post bro?

Ps. i'm look at amxmodx code and think that is easy to implement

klippy 12-26-2017 07:37

Re: [Suggestion] get_players flags
 
Quote:

Originally Posted by ^SmileY (Post 2568202)
Did you read post bro?

Ps. i'm look at amxmodx code and think that is easy to implement

We can't have it include "both" teams, because not all mods have 2 "main" teams and get_players() is a part of the Core, not CStrike.
Maybe if we change the prototype into
PHP Code:

native get_players(players[MAX_PLAYERS], &num, const flags[] = ""any:...); 

it would allow for
PHP Code:

new players[MAX_PLAYERS];
new 
playersCount;
get_players(playersplayersCount"e""TERRORIST""CT"); 

would also open up the possibility for more advanced flags in the future.

Depresie 12-26-2017 08:40

Re: [Suggestion] get_players flags
 
Well, it could also return all players that are not hltv/spec which should be compatible with all the other games i think

^SmileY 12-27-2017 08:02

Re: [Suggestion] get_players flags
 
Quote:

Originally Posted by KliPPy (Post 2568207)
We can't have it include "both" teams, because not all mods have 2 "main" teams and get_players() is a part of the Core, not CStrike.
Maybe if we change the prototype into
PHP Code:

native get_players(players[MAX_PLAYERS], &num, const flags[] = ""any:...); 

it would allow for
PHP Code:

new players[MAX_PLAYERS];
new 
playersCount;
get_players(playersplayersCount"e""TERRORIST""CT"); 

would also open up the possibility for more advanced flags in the future.

Also can be in this way, since amxx core can check the game teams.

Ps. you not need to check both teams since in loop can skip "SPECTATORS" and "HLTV"

OciXCrom 12-28-2017 14:49

Re: [Suggestion] get_players flags
 
It would be nice to add a flag in the get_players function that will find players with certaing admin flags only.

get_players(iPlayers, iPnum, "j", "abcdeimnu")

CrazY. 12-28-2017 19:48

Re: [Suggestion] get_players flags
 
Will change what, your suggestion compared to the default way to run two loops? Just optimization?

OciXCrom 12-28-2017 19:50

Re: [Suggestion] get_players flags
 
It's much more convinient to do this in one line instead of doing the same thing multiple times.

OciXCrom 01-01-2018 09:24

Re: [Suggestion] get_players flags
 
https://github.com/alliedmodders/amxmodx/pull/476 - I've managed to make the admin flags part. I may or may not try to do the multiple teams one.

PHP Code:

/* This will match players that have all of the "abcdei" admin flags */
get_players(iPlayersiPnum"j""abcdei")

/* This will match players that have any of the "abcdei" admin flags */
get_players(iPlayersiPnum"k""abcdei"



All times are GMT -4. The time now is 23:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.