Fixed ADMIN_ALL bug
This commit is contained in:
parent
3700b8b39f
commit
ef90960121
@ -11,17 +11,22 @@
|
|||||||
#endif
|
#endif
|
||||||
#define _amxmisc_included
|
#define _amxmisc_included
|
||||||
|
|
||||||
|
stock is_user_admin(id)
|
||||||
|
{
|
||||||
|
return ( get_user_flags(id)>0 && !(get_user_flags(id)&ADMIN_USER) )
|
||||||
|
}
|
||||||
|
|
||||||
stock cmd_access(id,level,cid,num) {
|
stock cmd_access(id,level,cid,num) {
|
||||||
new has_access = 0
|
new has_access = 0
|
||||||
if ( id==(is_dedicated_server()?0:1) ) {
|
if ( id==(is_dedicated_server()?0:1) ) {
|
||||||
has_access = 1
|
has_access = 1
|
||||||
}
|
} else if ( level==ADMIN_ADMIN ) {
|
||||||
else if ( level==ADMIN_ADMIN ) {
|
|
||||||
if ( is_user_admin(id) )
|
if ( is_user_admin(id) )
|
||||||
has_access = 1
|
has_access = 1
|
||||||
}
|
} else if ( get_user_flags(id) & level ) {
|
||||||
else if ( get_user_flags(id) & level ) {
|
|
||||||
has_access = 1
|
has_access = 1
|
||||||
|
} else if (level == ADMIN_ALL) {
|
||||||
|
has_access = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( has_access==0 ) {
|
if ( has_access==0 ) {
|
||||||
@ -44,10 +49,6 @@ stock access(id,level) {
|
|||||||
return (get_user_flags(id) & level)
|
return (get_user_flags(id) & level)
|
||||||
}
|
}
|
||||||
|
|
||||||
stock is_user_admin(id) {
|
|
||||||
return ( get_user_flags(id)>0 && !(get_user_flags(id)&ADMIN_USER) )
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Flags:
|
/* Flags:
|
||||||
* 1 - obey immunity
|
* 1 - obey immunity
|
||||||
* 2 - allow yourself
|
* 2 - allow yourself
|
||||||
|
Loading…
Reference in New Issue
Block a user