Raised This Month: $51 Target: $400
 12% 

get_user_flags mistake


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-19-2010 , 16:30   get_user_flags mistake
Reply With Quote #1

Code:
public check_admin(id) {     new iFlags = get_user_flags(id);     if (!(iFlags & ADMIN_LEscVEL_A))     {         if (iFlags & ADMIN_LEVEL_B) // Dosn't work         {             g_admin[id] = 3             client_print(0, print_chat, "admin 3")         }         else if (iFlags & ADMIN_LEVEL_C)         {             g_admin[id] = 2             client_print(0, print_chat, "admin 2")         }     }     else     {         g_admin[id] = 4         client_print(0, print_chat, "admin 4")     }     return PLUGIN_HANDLED }

This

PHP Code:
if (iFlags ADMIN_LEVEL_B// Dosn't work
{
        
g_admin[id] = 3
        client_print
(0print_chat"admin 3")

Not work :S
PattyBiena is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-19-2010 , 16:34   Re: get_user_flags mistake
Reply With Quote #2

What flag is ADMIN_LEscVEL_A?

When are you calling this function? Does your test account not have admin_level_a flag and have admin_level_b? Check your users.ini file for the correct letter that corresponds to each admin level.
__________________

Last edited by Bugsy; 07-19-2010 at 16:38.
Bugsy is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-19-2010 , 16:38   Re: get_user_flags mistake
Reply With Quote #3

PHP Code:
if (!(iFlags ADMIN_LEscVEL_A)) 
ADMIN_LEscVEL_A
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-19-2010 , 16:39   Re: get_user_flags mistake
Reply With Quote #4

PHP Code:
if (!(iFlags ADMIN_LEscVEL_A)) 
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-19-2010 , 16:39   Re: get_user_flags mistake
Reply With Quote #5

User:
Quote:
"admin 2" "123456" " jigfecbo " "ak" ; ACCES O
"admin 3" "123456" " jigfecbn " "ak" ; ACCES N
"admin 4" "123456" " jigfecbm " "ak" ; ACCES M
I called on putinserver and

PHP Code:
public client_infochanged(id)
{
    if (!
is_user_alive(id)) return PLUGIN_HANDLED

    
    
new szNewname[32], szOldname[32]
    
    
get_user_info(id"name"szNewname,31)
    
get_user_name(idszOldname,31)
    
strtolower(szNewname)
    
strtolower(szOldname)
    
    if (
equal(szOldnameszNewname)) return PLUGIN_HANDLED 
    
if (!equal(szOldnameszNewname))
    {
        
engclient_cmd(id"setinfo""name"szNewname)
        
g_admin[id] = 1
        check_admin
(id)
    }
    
    
    return 
PLUGIN_HANDLED

All admin works, exept admin 2.
PattyBiena is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-19-2010 , 16:44   Re: get_user_flags mistake
Reply With Quote #6

Quote:
Originally Posted by Jelle View Post
PHP Code:
if (!(iFlags ADMIN_LEscVEL_A)) 
Typing error after paste
PattyBiena is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-19-2010 , 18:18   Re: get_user_flags mistake
Reply With Quote #7

Quote:
Originally Posted by PattyBiena View Post
Code:
"admin 2" "123456" " jigfecbo " "ak" ; ACCES O
"admin 3" "123456" " jigfecbn " "ak" ; ACCES N
"admin 4" "123456" " jigfecbm " "ak" ; ACCES M
All admin works, exept admin 2.
This statement and your first post contradict eachother.

This is the way it should probably be done (but I'm not sure if it will fix your problem whatever that may be):

PHP Code:
check_admin(id)
{
    new 
iFlags get_user_flags(id);
    if(
iFlags ADMIN_LEVEL_A// flag "m"
    
{
        
g_admin[id] = 4
        client_print
(0print_chat"admin 4")
    }
    else if(
iFlags ADMIN_LEVEL_B// flag "n"
    
{
        
g_admin[id] = 3
        client_print
(0print_chat"admin 3")
    }
    else if(
iFlags ADMIN_LEVEL_C// flag "o"
    
{
        
g_admin[id] = 2
        client_print
(0print_chat"admin 2")
    }

__________________
fysiks is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-19-2010 , 19:18   Re: get_user_flags mistake
Reply With Quote #8

PHP Code:
check_admin(id)
{
    new 
iFlags get_user_flags(id);
    if(
iFlags ADMIN_LEVEL_A// flag "m"
    
{
        
g_admin[id] = 4
        client_print
(0print_chat"admin 4")
    }
    else if(
iFlags ADMIN_LEVEL_B// flag "n"
    
{
        
g_admin[id] = 3
        client_print
(0print_chat"admin 3")
    }
    else if(
iFlags ADMIN_LEVEL_C// flag "o"
    
{
        
g_admin[id] = 2
        client_print
(0print_chat"admin 2")
    }

Now only works admin 4, lol xD
PattyBiena is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-19-2010 , 19:32   Re: get_user_flags mistake
Reply With Quote #9

Quote:
Originally Posted by PattyBiena View Post
Now only works admin 4, lol xD
What are you admin flags in users.ini?
__________________
fysiks is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-19-2010 , 19:40   Re: get_user_flags mistake
Reply With Quote #10

I use 3 admins with different flags.

Quote:
"Adm1" "123456" " jigfecbo " "ak"; ACCESS O
"Adm2" "123456" " jigfecbn " "ak"; ACCESS N
"Adm3" "123456" " jigfecbm " "ak"; ACCESS M
PattyBiena 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 08:09.


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