Raised This Month: $32 Target: $400
 8% 

How to get Players ( Count ) with Specific Flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-14-2018 , 08:54   How to get Players ( Count ) with Specific Flags
Reply With Quote #1

My question is, How can i get players with Specified flag from Server, if i want to put them as a Item in another Item in a Menu !!

For Example this is my Case :

Menu :

OWNERS
ADMINS

Now , how can i add players with ADMIN_RCON flag to owners and simultaneously do same with ADMIN_BAN to add in ADMINS ??
I tried doing like this :
PHP Code:
for(new 0numi++) {
        
players[i];
        
        
get_user_name(xname32);
        
num_to_str(xtemp[0], 2);
        
formatex(temp[1], 127"%s%s"name, (get_user_flags(x) & ADMIN_RCON) ? "\r[OWNER]" "");
        
menu_additem(newmenutemp[1], temp[0]); 
Bt this will get all players inb menu and make a Suffix to the Rcon players as ( OWNER )

I want only to collect the players with RCON and BAN and put them under OWNER and ITEM as a list
Help ...

Last edited by instinctpt1; 02-14-2018 at 08:55. Reason: fixed
instinctpt1 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-14-2018 , 10:29   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #2

Loop through all online players and check if they own specific flag.
__________________
Relaxing is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-15-2018 , 08:30   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #3

Look what i asked, I dont know how to add that to a menu !!

You are not providing Solution bro I dont know how to do it , and u are texting just language that i already know
instinctpt1 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-15-2018 , 09:44   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #4

Code:
for (static id = 1; id <= get_maxplayers(); id++){     if (is_user_admin(id){         if (has_flags(id, "abcdeghijklmnopqrstu")){             // create a submenu and then             // gather all owner's names and add them as a item or even a blank         } else if (has_flags(id, "bit")){             // also for this         }     } }
Are you looking for something like this or I have no clue what I'm trying to do?
__________________

Last edited by Relaxing; 02-15-2018 at 18:18. Reason: Using get_playersnum(PLUGIN_HANDLED) works
Relaxing is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 02-16-2018 , 12:55   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #5

Quote:
Originally Posted by instinctpt1 View Post
Look what i asked, I dont know how to add that to a menu !!

You are not providing Solution bro I dont know how to do it , and u are texting just language that i already know

Ppl ask for help and reply rude a.f I never understand why some feel entitled to being helped
blood2k is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-17-2018 , 04:18   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #6

Quote:
Originally Posted by blood2k View Post
Ppl ask for help and reply rude a.f I never understand why some feel entitled to being helped
Hehe I was not Rude bro, i Just told him that i know what to do, but dont know how to do thats why i asked for Help and he again told me what to do

But then he told me how to do too xD

Bt still i dont understood, What about the Menu part how can i make a Submenu in a Item and then add Name of players with Specific Privilege to it
instinctpt1 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-17-2018 , 06:02   Re: How to get Players ( Count ) with Specific Flags
Reply With Quote #7

Quote:
Originally Posted by instinctpt1 View Post
Hehe I was not Rude bro, i Just told him that i know what to do, but dont know how to do thats why i asked for Help and he again told me what to do

But then he told me how to do too xD

Bt still i dont understood, What about the Menu part how can i make a Submenu in a Item and then add Name of players with Specific Privilege to it
The for loop must be used twice, once for the menu, so it checks for specific players, if there are it creates a submenu of the specific rank.
Next we use the loop again to find those players who are holding those flags that we're catching and adding their name to the submenu, neither an item or a blanker.
__________________
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:45.


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