PHP Code:
#include <amxmodx>
#include <geoip>
#include <colorchat>
#define PLUGIN "Test plugin by shehzad"
#define VERSION "1.0"
#define AUTHOR "Muhammad shehzad"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public client_putinserver(id)
{
set_task(10.0, "OwnerWelcome", id)
}
public OwnerWelcome(id)
{
if( !is_user_bot(id) ) {
new szName[32], szIP[21], szCountry[46], szCity[21]
get_user_name(id, szName, charsmax(szName))
get_user_ip(id, szIP, charsmax(szIP))
geoip_country(szIP, szCountry, charsmax(szCountry))
geoip_city(szIP, szCity, charsmax(szCity))
if( get_user_flags(id) & ADMIN_RCON )
ColorChat(0, GREY, "^4P[K]K^3 OWNER^4 %s ^3has connected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
else if( get_user_flags(id) & ADMIN_KICK )
ColorChat(0, GREY, "^4P[K]K^3 Admin^4 %s ^3has connected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
else
ColorChat(0, GREY, "^4P[K]K^3 Player^4 %s ^3has connected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
}
}
public client_disconnect( id )
{
if( !is_user_bot(id) )
{
new szName[32], szIP[21], szCountry[46], szCity[21]
get_user_name(id, szName, charsmax(szName))
get_user_ip(id, szIP, charsmax(szIP))
geoip_country(szIP, szCountry, charsmax(szCountry))
geoip_city(szIP, szCity, charsmax(szCity))
if( get_user_flags(id) & ADMIN_RCON )
ColorChat(0, GREY, "^4P[K]K^3 OWNER^4 %s ^3has disconnected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
else if( get_user_flags(id) & ADMIN_KICK )
ColorChat(0, GREY, "^4P[K]K^3 Admin^4 %s ^3has disconnected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
else
ColorChat(0, GREY, "^4P[K]K^3 Player^4 %s ^3has disconnected! ^1[^4Country^1:^3%s^1][^4City^1:^3%s^1]", szName, szCountry, szCity);
}
}