Raised This Month: $12 Target: $400
 3% 

Solved Other flags?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theodore Bagwell
Member
Join Date: Jan 2021
Location: USA
Old 01-23-2021 , 13:13   Other flags?
Reply With Quote #1

Hi. I know there are no flags like x, wy, v in amxmod x. Therefore, plug-ins cannot be set on them. But I have seen servers that have some of these plugins with these flags? how is it possible? Is this possible to do so?

I tried
PHP Code:
    if( !has_flagid"x" ) )
    {
        return 
PLUGIN_HANDLED;
    } 
But I do not know if this is true or not.

Last edited by Theodore Bagwell; 01-23-2021 at 14:14.
Theodore Bagwell is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-23-2021 , 13:35   Re: Other flags?
Reply With Quote #2

Quote:
Originally Posted by Theodore Bagwell View Post
Hi. I know there are no flags like x, wy, v in amxmod x. Therefore, plug-ins cannot be set on them. But I have seen servers that have some of these plugins with these flags? how is it possible? Is this possible to do so?

I tried
PHP Code:
    if( !has_flagid"x" ) )
    {
        return 
PLUGIN_HANDLED;
    } 
But I do not know if this is true or not.
Well, check it by yourself:
PHP Code:
// In plugin_init() we register our test func
register_clcmd("amx_test""clcmd_test")

// Testing if client has or not flag "x"
public clcmd_test(id)
{
    if(
has_flag(id"x"))
    {
        
client_print(idprint_chat"You have flag ^"x^"")
    }
    else 
    {
        
client_print(idprint_chat"You don't have flag ^"x^"")
    }

And about "there are no flag like w or x", it exists, but are not defined by default. To access bitsum value of flag:
PHP Code:
(1<<22/* flag "w" */
(1<<23/* flag "x" */ 
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 01-23-2021 at 13:37.
Shadows Adi is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-23-2021 , 13:36   Re: Other flags?
Reply With Quote #3

This is the current list of flags:

Code:
#define ADMIN_ALL           0       /* everyone */ #define ADMIN_IMMUNITY      (1<<0)  /* flag "a" */ #define ADMIN_RESERVATION   (1<<1)  /* flag "b" */ #define ADMIN_KICK          (1<<2)  /* flag "c" */ #define ADMIN_BAN           (1<<3)  /* flag "d" */ #define ADMIN_SLAY          (1<<4)  /* flag "e" */ #define ADMIN_MAP           (1<<5)  /* flag "f" */ #define ADMIN_CVAR          (1<<6)  /* flag "g" */ #define ADMIN_CFG           (1<<7)  /* flag "h" */ #define ADMIN_CHAT          (1<<8)  /* flag "i" */ #define ADMIN_VOTE          (1<<9)  /* flag "j" */ #define ADMIN_PASSWORD      (1<<10) /* flag "k" */ #define ADMIN_RCON          (1<<11) /* flag "l" */ #define ADMIN_LEVEL_A       (1<<12) /* flag "m" */ #define ADMIN_LEVEL_B       (1<<13) /* flag "n" */ #define ADMIN_LEVEL_C       (1<<14) /* flag "o" */ #define ADMIN_LEVEL_D       (1<<15) /* flag "p" */ #define ADMIN_LEVEL_E       (1<<16) /* flag "q" */ #define ADMIN_LEVEL_F       (1<<17) /* flag "r" */ #define ADMIN_LEVEL_G       (1<<18) /* flag "s" */ #define ADMIN_LEVEL_H       (1<<19) /* flag "t" */ #define ADMIN_MENU          (1<<20) /* flag "u" */ #define ADMIN_BAN_TEMP      (1<<21) /* flag "v" */ #define ADMIN_ADMIN         (1<<24) /* flag "y" */ #define ADMIN_USER          (1<<25) /* flag "z" */

As you can see, the 2 that are missing can easily be added.

Code:
#define ADMIN_FLAG_W (1<<22) /* flag "w" */ #define ADMIN_SUPER (1<<23) /* flag "x" */

Or whatever you want to name them.

Either add them in your .sma, or in some .inc file.
If you don't need to use the constants, "has_flag" works just fine.
You can also use them in cmdaccess.ini or users.ini without any problems.
__________________

Last edited by OciXCrom; 01-23-2021 at 13:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Theodore Bagwell
Member
Join Date: Jan 2021
Location: USA
Old 01-23-2021 , 14:13   Re: Other flags?
Reply With Quote #4

Thank you guys! It helped a lot.
Theodore Bagwell is offline
Reply


Thread Tools
Display Modes

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 13:59.


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