AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin-vip connect? Help (https://forums.alliedmods.net/showthread.php?t=156569)

Garrey 05-08-2011 15:12

Admin-vip connect? Help
 
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 


fysiks 05-08-2011 15:32

Re: Admin-vip connect? Help
 
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.

SonicSonedit 05-08-2011 15:46

Re: Admin-vip connect? Help
 
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)
    }



Garrey 05-09-2011 03:09

Re: Admin-vip connect? Help
 
Quote:

Originally Posted by SonicSonedit (Post 1465769)
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 :(

fysiks 05-09-2011 04:34

Re: Admin-vip connect? Help
 
Quote:

Originally Posted by Garrey (Post 1465991)
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.

K.K.Lv 05-09-2011 05:31

Re: Admin-vip connect? Help
 
just see the admin.sma code !

SonicSonedit 05-09-2011 07:04

Re: Admin-vip connect? Help
 
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)
    }


http://xmages.net/storage/10/1/0/9/d...d/43ad1a91.jpghttp://xmages.net/storage/10/1/0/1/b...d/715ff8b8.jpg


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).


All times are GMT -4. The time now is 04:21.

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