AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me FIX Admin Check (https://forums.alliedmods.net/showthread.php?t=171879)

MiloSx7 11-12-2011 05:42

Help me FIX Admin Check
 
PHP Code:

public ShowVIPOnline(id)
{
    if(
get_pcvar_num(p_VIPCheck) == 1)
    {
        new 
vipnames[33][64]
        
        if(
is_user_connected(0))
        {
            if(
get_user_flags(0) & ADMIN_LEVEL_C)
            {
                
get_user_name(0vipnames[0], charsmax(vipnames))
                
ColorChat(idGREEN"VIP Online: %s"vipnames[0], charsmax(vipnames))
            }
        }
        
        else 
        {
            
ColorChat(idGREEN"[^3V.I.P^4] ^1No ^3V.I.P-a ^1online")
            return 
PLUGIN_HANDLED
        
}
    }
    else
    {
        
ColorChat(idGREEN"[^3V.I.P^4] ^3V.I.P's ^1Online ^4DISABLEDD")
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE


It seems not to work, because i always see No VIP Online -.-
Can you help me somehow to fix this i know I'm near to the solution..

Arkshine 11-12-2011 05:57

Re: Help me FIX Admin Check
 
is_user_connected(0)

get_user_flags(0)

get_user_name(0

vipnames[0]

...

No comment.

JoKeR LauGh 11-12-2011 06:43

Re: Help me FIX Admin Check
 
your index should be ( id )

Snaker beatter 11-12-2011 09:22

Re: Help me FIX Admin Check
 
Try to:

This:
PHP Code:

        if(is_user_connected(0))
        {
            if(
get_user_flags(0) & ADMIN_LEVEL_C)
            {
                
get_user_name(0vipnames[0], charsmax(vipnames))
                
ColorChat(idGREEN"VIP Online: %s"vipnames[0], charsmax(vipnames))
            }
        } 

Should be:
PHP Code:

        if(is_user_connected(id))
        {
            if(
get_user_flags(id) & ADMIN_LEVEL_C)
            {
                
get_user_name(idvipnamescharsmax(vipnames))
                
ColorChat(idGREEN"VIP Online: %s"vipnames)
            }
        } 

UNTESTED

ConnorMcLeod 11-12-2011 09:26

Re: Help me FIX Admin Check
 
if(is_user_connected(id))

This is useless since "say" command should registered with register_clcmd and no register_concmd and since even if it ise registered with register_concmd server cmd "say" can't be hooked with amxx default system.


All times are GMT -4. The time now is 08:29.

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