Raised This Month: $ Target: $400
 0% 

(dis)connect messages with country not working :/


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-18-2011 , 12:35   (dis)connect messages with country not working :/
Reply With Quote #1

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)

__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:00   Re: (dis)connect messages with country not working :/
Reply With Quote #2

Quote:
Originally Posted by georgik57 View Post
but it doesn't want to work at all
What does that mean? What have you tried to debug it?
__________________
fysiks is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-18-2011 , 13:18   Re: (dis)connect messages with country not working :/
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
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
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:32   Re: (dis)connect messages with country not working :/
Reply With Quote #4

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.
__________________
fysiks 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 19:45.


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