Preventing the names from repeating
I have an admin_who plugin. I changed the check to include the flags, instead of equaling them. Why? Because the VIP flag is ADMIN_LEVEL_H, so if I add the t flag to an admin, he won't be shown in the admin list anymore. This way he would. The problem is that a founder will appear in all admin cathegories, as he fits them all, having full access. How could I add a check to prevent him from repeating? I mean placing him in the highest rank his flags allow him, but no lower.
Here's my code: PHP Code:
|
Re: Preventing the names from repeating
Switch the two for-loops. Put the groups loop inside the player loop, then check if the player has the flags, and if he does, simply add "break" in the groups loop, so the other groups below it don't get checked. Also, don't get the player's name before making sure that he has the flags.
|
Re: Preventing the names from repeating
The flags that you added at this plugin, you need to add the same flags in users.ini, if not it does not appear.
Example: "VIP" Flags: "Abcdefh" You will add at users.ini "EFFx" "fuckingpassword" "abcdefh" "a" Do you already tryed it? |
Re: Preventing the names from repeating
Did you even read the question?
|
Re: Preventing the names from repeating
Quote:
Quote:
Apparently, I messed it up again. It didn't double anything, that's a relief. I guess I scrambled the loops doe, as I tested it and it showed a founder as a helper and an owner as a slot. Then it kept showing different combinations. Please end my pain... |
Re: Preventing the names from repeating
Check flag t remove it and then do equal , it's so hard?
PHP Code:
|
Re: Preventing the names from repeating
I changed the way the plugin works by assigning the player group when the player connects. The who command will then match the players group with the list of groups as you loop through the groups. I also added a 'Player' group that will display players who do not match any of the defined groups. You can disable this group using the cvar aw_displayplayers. Let me know if this does what you want.
PHP Code:
|
Re: Preventing the names from repeating
Quote:
Quote:
|
| All times are GMT -4. The time now is 18:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.