Why do you tell people it is impossible without getting informed?
And wait for the plugin.
PHP Code:
#include <amxmodx>
#if defined geoip_included
#endinput
#endif
#define _geoip_included
#if AMXX_VERSION_NUM >= 175
#pragma reqlib geoip
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib geoip
#endif
#else
#pragma library geoip
#endif
native geoip_country_ex(const ip[], result[], len, id = -1);
native geoip_city(const ip[], result[], len, id = -1);
#define MAXPLAYER 32
new id_send;
new TeamInfo;
new SayText;
new bool:IsConnected[MAXPLAYER + 1];
new g_szSoundFile[] = "buttons/blip1.wav";
public plugin_init()
{
register_plugin("IP Join Info", "1.1", "idk");
TeamInfo = get_user_msgid("TeamInfo");
SayText = get_user_msgid("SayText");
}
public plugin_precache()
{
precache_sound(g_szSoundFile);
}
public client_putinserver(player)
{
IsConnected[player] = true;
show_msg(player, true)
client_cmd(0, "spk %s", g_szSoundFile)
}
public client_disconnect(player)
{
IsConnected[player] = false;
show_msg(player, false)
}
public client_authorized(player)
{
IsConnected[player] = false;
}
public show_msg(player, connect){
new user[32],ip[16],Country[33],City[33],msg[200],len;
get_user_ip(player, ip , 15, 1)
get_user_name(player,user,31)
geoip_country_ex(ip,Country, 32)
geoip_city(ip, City, 32);
len=format(msg,199,"^x04%s ^x01",user);
len+=format(msg[len],199," %s", connect ? "has connected" : "disconnect");
if(strlen(Country) && strlen(City))
len+=format(msg[len],199," (^x03%s^x01, ^x03%s^x01)",Country, City);
else
if(strlen(Country) || strlen(City))
len+=format(msg[len],199," (^x03%s%s^x01)",Country, City);
print_in_chat(0, msg);
}
public print_in_chat(id, const msg[])
{
if(id && IsConnected[id]) id_send=id
else id_send=get_player()
if (id_send!=-1)
{
new team;
team = get_user_team(id_send);
static message[256];
vformat(message, 255, msg, 3);
message[192] = '^0';
Team_Info(id_send,"TERRORIST");
message_begin(MSG_ALL, SayText, {0, 0, 0}, id);
write_byte(id_send);
write_string(message);
message_end();
TeamSelection(id_send, team);
}
return 1;
}
Team_Info(id, team[])
{
message_begin(MSG_ALL, TeamInfo);
write_byte(id);
write_string(team);
message_end();
return 1;
}
TeamSelection(index, team)
{
switch(team)
{
case 0:
{
Team_Info(index, "");
}
case 1:
{
Team_Info(index, "TERRORIST");
}
case 2:
{
Team_Info(index, "CT");
}
case 3:
{
Team_Info(index, "SPECTATOR");
}
}
}
get_player()
{
for( new plr = 1; plr <= MAXPLAYER; plr++ )
{
if( IsConnected[plr] )
{
return plr;
}
}
return -1;
}