Raised This Month: $ Target: $400
 0% 

Creating new ADMIN_ flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-05-2007 , 19:18   Creating new ADMIN_ flag
Reply With Quote #1

Can someone tell me hot to create new admin flag? In includes i didn't found anything, in admin.sma & admincmd.sma i didn't found anything as well. Please help. Give me an e.x. how is ADMIN_IMMUNITY or any other ACCESS FLAG is creating. Thx.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-05-2007 , 20:09   Re: Creating new ADMIN_ flag
Reply With Quote #2

I don't believe it is possible to create more admin flags

For checking admin flags you would have to

if(get_user_flags(id) & ADMIN_FLAG){
//User has ADMIN_FLAG
}

The different ADMIN_FLAGs can be found at:
http://www.amxmodx.org/funcwiki.php?...=1#const_admin
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-06-2007 , 09:09   Re: Creating new ADMIN_ flag
Reply With Quote #3

I just read amxmodx.inc, it contains amxconst.inc where ADMIN_ is scripted. So if i will change lines from:
Quote:
#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<< /* 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<<1 /* flag "s" */
#define ADMIN_LEVEL_H (1<<19) /* flag "t" */
#define ADMIN_MENU (1<<20) /* flag "u" */
#define ADMIN_ADMIN (1<<24) /* flag "y" */
#define ADMIN_USER (1<<25) /* flag "z" */
to:
Quote:
#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<< /* 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<<1 /* flag "s" */
#define ADMIN_LEVEL_H (1<<19) /* flag "t" */
#define ADMIN_MENU (1<<20) /* flag "u" */
/*#define ADMIN_LEVEL_V (1<<21) /*/* flag "v" */
/*#define ADMIN_LEVEL_W (1<<22) /*/* flag "w" */
#define ADMIN_SUPRIME (1<<23) /* flag "x" */
#define ADMIN_ADMIN (1<<24) /* flag "y" */
#define ADMIN_USER (1<<25) /* flag "z" */
will the ADMIN_SUPRIME (flag X) will work?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-06-2007 , 17:53   Re: Creating new ADMIN_ flag
Reply With Quote #4

Probally not. I would just use the generic ones.
Styles is offline
Send a message via AIM to Styles
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 04-06-2007 , 18:30   Re: Creating new ADMIN_ flag
Reply With Quote #5

If it worked, it would only work if a specific plugin actively looks for that flag.
__________________
Brad is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-07-2007 , 18:54   Re: Creating new ADMIN_ flag
Reply With Quote #6

Yes, it works, it works in plugins, if flag is, but i changed amxmisc.inc as well, form:

Quote:
...
if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) )
...
to:

Quote:
...
if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) && !(get_user_flags(id)&ADMIN_SUPRIME) )
...
and evrything seems to be perfect. I just hed to recomplite all plugins, that head functions cmd_target.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 04-07-2007 at 18:57.
MPNumB is offline
Send a message via Skype™ to MPNumB
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 04-07-2007 , 23:07   Re: Creating new ADMIN_ flag
Reply With Quote #7

I don't know if you care, but it's spelled "supreme".
__________________
Brad 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 06:40.


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