Raised This Month: $ Target: $400
 0% 

Admin-vip connect? Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Garrey
Member
Join Date: Jan 2010
Old 05-08-2011 , 15:12   Admin-vip connect? Help
Reply With Quote #1

Hi,
I have this code but it doesn't working. :/ Could anyone fix it?

PHP Code:
#include <amxmodx>
#include <amxmisc> 

public plugin_init()
{
    
register_plugin("ADMIN/VIP Teavitus","0.01","FREE COPY")
}

public 
client_putinserver(id)
{
    new 
name[33]
    
get_user_name(id,name,32)
    
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"VIP %s joined with server!",name)
        
        return 
PLUGIN_HANDLED
    
}
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"ADMIN %s joined with server!",name)
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED 
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2011 , 15:32   Re: Admin-vip connect? Help
Reply With Quote #2

Debug it. See if it's actually getting to the code that shows the message. Use console_print() or something to see if it's actually getting there.
__________________
fysiks is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-08-2011 , 15:46   Re: Admin-vip connect? Help
Reply With Quote #3

Garrey
Try this:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("ADMIN/VIP Teavitus","0.01","FREE COPY")
}

public 
client_putinserver(id)
{
    static 
name[33]
    
get_user_name(id,name,charsmax(name))
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"ADMIN %s joined with server!",name)
    }
    else if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"VIP %s joined with server!",name)
    }

__________________

SonicSonedit is offline
Garrey
Member
Join Date: Jan 2010
Old 05-09-2011 , 03:09   Re: Admin-vip connect? Help
Reply With Quote #4

Quote:
Originally Posted by SonicSonedit View Post
Garrey
Try this:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("ADMIN/VIP Teavitus","0.01","FREE COPY")
}

public 
client_putinserver(id)
{
    static 
name[33]
    
get_user_name(id,name,charsmax(name))
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"ADMIN %s joined with server!",name)
    }
    else if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"VIP %s joined with server!",name)
    }

Hei. Thanks, but it doesn't working
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2011 , 04:34   Re: Admin-vip connect? Help
Reply With Quote #5

Quote:
Originally Posted by Garrey View Post
Hei. Thanks, but it doesn't working
That's because he didn't "fix" anything. You need to debug it as I said before. You need to find out if the code is actually reaching the hud message part. First, make sure that client_putinserver() is being called.
__________________
fysiks is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 05-09-2011 , 05:31   Re: Admin-vip connect? Help
Reply With Quote #6

just see the admin.sma code !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-09-2011 , 07:04   Re: Admin-vip connect? Help
Reply With Quote #7

fysiks
Quote:
That's because he didn't "fix" anything.
That is not true.
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("ADMIN/VIP Teavitus","0.01","FREE COPY")
}

public 
client_putinserver(id)
{
    static 
name[33]
    
get_user_name(id,name,charsmax(name))
    
server_print("%s connected.",name)
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
server_print("Admin detected.")
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"ADMIN %s joined with server!",name)
    }
    else if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
server_print("Vip detected.")
        
set_hudmessage(25500, -1.00.0006.012.0)
        
show_hudmessage(0,"VIP %s joined with server!",name)
    }




Garrey
Try to change hudmessage coordinates/time.
Also, the one who just connected will not see hudmessage.
And just in case: ADMIN_LEVEL_H is "t" access flag (see 2nd pic).
__________________


Last edited by SonicSonedit; 05-09-2011 at 07:09.
SonicSonedit 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 04:21.


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