AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin levels and flags (https://forums.alliedmods.net/showthread.php?t=60491)

Rikimaru 09-05-2007 03:23

Admin levels and flags
 
1 Attachment(s)
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.

_Master_ 09-05-2007 07:07

Re: Admin levels and flags
 
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.

Battousai-sama 09-08-2007 16:57

Re: Admin levels and flags
 
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.

Lee 09-08-2007 21:43

Re: Admin levels and flags
 
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.

Battousai-sama 09-08-2007 22:23

Re: Admin levels and flags
 
Huh?

i used GHW's custom compiler which works fine for me on almost all plugins.

Lee 09-08-2007 23:11

Re: Admin levels and flags
 
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.)

Roach 09-14-2007 09:59

Re: Admin levels and flags
 
And here it comes...

THE MAGICAL MOVE...

OFF TO THE SCRIPTING HELP FORUM!!

ZOOM!!


All times are GMT -4. The time now is 16:11.

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