Own custom admin flags
Hello there.
So, in my server I have like more than 30 console admin commands. My question is instead of using the delay admin flags which are like "abcdef...", How can I use flags like - @#$ ?? I means I want to use "@" as a flag. How to do it ? |
Re: Own custom admin flags
Flags are stored in a bitsum in a 4-byte cell (32 bits) so you are limited to 32 flags. The way they are read using read_flags() is flags |= ( 1 << [char] - 'a') . So it's basically subtracting the ascii code for 'a' from each character you give to it, so you can go beyond character 'z' until you reach 'a' + 31.
I am not certain whether or not AMX-X uses these bits for anything, can anyone involved with AMX-X development weigh in? Below are the characters and ASCII codes that can possibly be used as flags: { = 123 | = 124 } = 125 ~ = 126 Char 127 (character does not display in editors or forum so I would avoid using it) € = 128 Can be added to your plugin: Code:
#define ADMIN_CUSTOM1 (1<<26) /* flag "{" */Code:
void UTIL_GetFlags(char* f, int a) |
Re: Own custom admin flags
Then update me up in this thread when you find a better way
|
Re: Own custom admin flags
You'll probably need some other method for this rather than flags, because you have limited flags, but unlimited commands.
I'm currently working on a very flexible permission-based plugin/admin system that allows you to use permissions for each command instead of admin flags (e.g. for amx_slap you would need amxcmd.slap permission or amxcmd.* for all commands). Maybe you can use that when I release it. |
Re: Own custom admin flags
Can do something like this, or wait for OciXCrom's plugin.
set_permission <name> <- or +> <permission #> Code:
set_permission bugsy + 2PHP Code:
|
Re: Own custom admin flags
Any better way of permission system ?
|
Re: Own custom admin flags
What's wrong with our suggestions?...
|
Re: Own custom admin flags
Quote:
Not only flags itself, since change a ~ z for symbols do not make any sense. |
Re: Own custom admin flags
Quote:
Heres an example PHP Code:
|
Re: Own custom admin flags
Quote:
|
| All times are GMT -4. The time now is 03:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.