AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   access() broken? (https://forums.alliedmods.net/showthread.php?t=17706)

bahr 09-07-2005 07:59

access() broken?
 
Is it me or something is wrong with access() ?

Code:
public client_putinserver(id) {     get_user_name(id, name, 32)     set_hudmessage(120, 120, 200, X, Y, Effects, FxTime, HoldTime, FadeIn, FadeOut, Channel)     if (access(id, ADMIN_ADMIN)) {         log_amx(rndSuperAdmin[random(NUM_MSG)], name)         show_hudmessage(0, rndSuperAdmin[random(NUM_MSG)], name)     } else if (is_user_admin(id)) {         log_amx(rndAdmin[random(NUM_MSG)], name)         show_hudmessage(0, rndAdmin[random(NUM_MSG)], name)     } else {         show_hudmessage(0, "%s is ready to fight!", name)     } }

I got the super-admin msg even if I dont have ADMIN_ADMIN (flag "y") access!? (Im using AmxmodX 1.01)

v3x 09-07-2005 08:45

Try:
Code:
if(get_user_flags(id)&ADMIN_ADMIN) {     // .. }
Or
Code:
if(is_user_admin(id)) {     // .. }

bahr 09-07-2005 10:01

Thx! :wink:

But should we consider access() is broken then?

XxAvalanchexX 09-07-2005 15:12

No, access is fine. is_user_admin and ADMIN_ADMIN is the exact same thing. If you have any admin flag then it will say you have access to ADMIN_ADMIN.

Code:
stock access(id,level) {   if ( level==ADMIN_ADMIN )     return is_user_admin(id)   return (get_user_flags(id) & level) }


All times are GMT -4. The time now is 14:28.

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