Raised This Month: $ Target: $400
 0% 

Admin levels and flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rikimaru
Member
Join Date: Aug 2007
Old 09-05-2007 , 03:23   Admin levels and flags
Reply With Quote #1

I want to know the meanings of admin levels and I'm sure there a lot of people who can tell me that.
eg: ADMIN_IMMUNITY - flag "a", etc.

Also I wanna ask you people for some help. Here I've got an invisible plugin, where I want to change ADMIN_BAN to flag "n" and I'll be very thankful if someone will change it for me.
Attached Files
File Type: sma Get Plugin or Get Source (invisible.sma - 885 views - 1.2 KB)

Last edited by Rikimaru; 09-05-2007 at 03:27.
Rikimaru is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 09-05-2007 , 07:07   Re: Admin levels and flags
Reply With Quote #2

This is Scripting Help. It has nothing to do with AMXX Support/Help.

For admin levels check out amxconst.inc

Why would you change ADMIN_BAN value? Even if it's local to your plugin ? Flag "n" is assigned to ADMIN_LEVEL_B.
Just replace ADMIN_BAN with ADMIN_LEVEL_B in register_clcmd() and you're done.

In
PHP Code:
if (!(get_user_flags(id)&ADMIN_BAN)) 
replace ADMIN_BAN with "level" (passed as function argument) - it's the required level for that command (specified when registering the command).

No need to change core flags.
_Master_ is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 09-08-2007 , 16:57   Re: Admin levels and flags
Reply With Quote #3

Its has in a way.


Try the attached file i changed admin lvl.


and for the flags.. they are access level u can give urself or other admins in your server.

ADMIN_IMMUNITY = Admin with flag a ( no admin can kick ban slay or use any other commands on him )
ADMIN_KICK = you have access to kick people..
and so one for other levels they have theyr short name like IMMUNITY or KICK or BAN and so on.
__________________

Last edited by Battousai-sama; 10-09-2007 at 20:13.
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 09-08-2007 , 21:43   Re: Admin levels and flags
Reply With Quote #4

That won't change anything.

You need to alter the bit pattern comparison since cmd_access() was not used. Two different functions aren't necessary to perform a toggle operation - even if you want separate commands. You should also check to see if cmd_target() returns 0.
Lee is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 09-08-2007 , 22:23   Re: Admin levels and flags
Reply With Quote #5

Huh?

i used GHW's custom compiler which works fine for me on almost all plugins.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 09-08-2007 , 23:11   Re: Admin levels and flags
Reply With Quote #6

Almost all plugins use cmd_access(). This doesn't.

Code:
public visible(id,level,cid) {     if (!(get_user_flags(id)&ADMIN_BAN))     {         return PLUGIN_HANDLED     }
It might have been wise to use level in the bit comparison from the start. (Edit: As _Master_ already suggested.)

Last edited by Lee; 09-08-2007 at 23:14.
Lee is offline
Roach
Writes love letters to sawce Daily
Join Date: Jul 2006
Location: Internet
Old 09-14-2007 , 09:59   Re: Admin levels and flags
Reply With Quote #7

And here it comes...

THE MAGICAL MOVE...

OFF TO THE SCRIPTING HELP FORUM!!

ZOOM!!
__________________
Quote:
Originally Posted by Brad View Post
That sounds like a really good idea!
Now replace the word "good" with "dumb".
What was your rationale for proposing such a thing?
Roach 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 16:11.


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