AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   (dis)connect messages with country not working :/ (https://forums.alliedmods.net/showthread.php?t=155187)

georgik57 04-18-2011 12:35

(dis)connect messages with country not working :/
 
so i made this plugin...but it doesn't want to work at all
what can i do? :/
PHP Code:

#include <amxmodx>
#include <geoip>

new Ip1[48]
static 
szCountry[48], szName[32]

public 
plugin_init()
    
register_plugin("[ZPNM] (Dis)Connect Messages""1.0""9 3 () |2 9 ! /<")

public 
client_connect(id)
{
    
get_user_name(idszName31)
    
get_user_ip(idIp1471)
    
    
geoip_country(Ip1szCountry47)
    
    if(
equal(szCountry"error"))
    {
        if(!
contain(Ip1"192.168.") || !contain(Ip1"10.") || !contain(Ip1"172.") || equal(Ip1"127.0.0.1"))
            
szCountry "LAN"
        
else if(equal(Ip1"loopback"))
            
szCountry "LAN Owner"
        
else
            
szCountry "Unknown Country"
    
}
    
    
set_hudmessage(002550.010.1506.05.0)
    
show_hudmessage(id"Sosesc intariri!^n%s vine sa ne ajute!"szName)
}

public 
client_putinserver(id)
{
    
get_user_name(idszName31)
    
get_user_ip(idIp1471)
    
    
geoip_country(Ip1szCountry47)
    
    if(
equal(szCountry"error"))
    {
        if(!
contain(Ip1"192.168.") || !contain(Ip1"10.") || !contain(Ip1"172.") || equal(Ip1"127.0.0.1"))
            
szCountry "LAN"
        
else if(equal(Ip1"loopback"))
            
szCountry "LAN Owner"
        
else
            
szCountry "Unknown Country"
    
}
    
    
set_hudmessage(025500.010.1506.07.0)
    
show_hudmessage(id"%s a intrat in lupta!^n%s este din %s"szNameszNameszCountry)
}

public 
client_disconnect(id)
{
    
get_user_name(idszName31)
    
get_user_ip(idIp1471)
    
    
geoip_country(Ip1szCountry47)
    
    if(
equal(szCountry"error"))
    {
        if(!
contain(Ip1"192.168.") || !contain(Ip1"10.") || !contain(Ip1"172.") || equal(Ip1"127.0.0.1"))
            
szCountry "LAN"
        
else if(equal(Ip1"loopback"))
            
szCountry "LAN Owner"
        
else
            
szCountry "Unknown Country"
    
}
    
    
set_hudmessage(002550.010.1506.05.0)
    
show_hudmessage(id"%s ne'a parasit!^nSa speram ca va trimite ajutoare din %s..."szNameszCountry)



fysiks 04-18-2011 13:00

Re: (dis)connect messages with country not working :/
 
Quote:

Originally Posted by georgik57 (Post 1452974)
but it doesn't want to work at all

What does that mean? What have you tried to debug it?

georgik57 04-18-2011 13:18

Re: (dis)connect messages with country not working :/
 
Quote:

Originally Posted by fysiks (Post 1452999)
What does that mean? What have you tried to debug it?

it doesn't make any error logs and it doesn't show any hud message
i've also tried with the city, but removed it thinking that it's the cause of the problem

fysiks 04-18-2011 13:32

Re: (dis)connect messages with country not working :/
 
YOu need to learn to debug it. Is the plugin running? Is client_connect(), etc., being called at all? Do something that you know should work (client_print()). If it works then there is something wrong with the other code.


All times are GMT -4. The time now is 19:45.

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