| 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(id, szName, 31)
get_user_ip(id, Ip1, 47, 1)
geoip_country(Ip1, szCountry, 47)
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(0, 0, 255, 0.01, 0.15, 0, 6.0, 5.0)
show_hudmessage(id, "Sosesc intariri!^n%s vine sa ne ajute!", szName)
}
public client_putinserver(id)
{
get_user_name(id, szName, 31)
get_user_ip(id, Ip1, 47, 1)
geoip_country(Ip1, szCountry, 47)
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(0, 255, 0, 0.01, 0.15, 0, 6.0, 7.0)
show_hudmessage(id, "%s a intrat in lupta!^n%s este din %s", szName, szName, szCountry)
}
public client_disconnect(id)
{
get_user_name(id, szName, 31)
get_user_ip(id, Ip1, 47, 1)
geoip_country(Ip1, szCountry, 47)
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(0, 0, 255, 0.01, 0.15, 0, 6.0, 5.0)
show_hudmessage(id, "%s ne'a parasit!^nSa speram ca va trimite ajutoare din %s...", szName, szCountry)
}
|