Code:
#include < amxmodx >
#include < geoip >
#include < engine >
new g_szServerCountry[ 46 ];
public plugin_init( ) {
register_plugin( "Country Voice", "0.0.1", "Exolent" );
copy( g_szServerCountry, 45, GetUserCountry( 0 ) );
}
public client_putinserver( iPlayer ) {
if( equal( GetUserCountry( iPlayer ), g_szServerCountry ) ) {
set_speak( iPlayer, SPEAK_NORMAL );
} else {
set_speak( iPlayer, SPEAK_MUTED );
}
}
GetUserCountry( iPlayer ) {
static szIp[ 64 ];
get_user_ip( iPlayer, szIp, 63, 1 );
static szCountry[ 46 ];
geoip_country( szIp, szCountry, 45 );
return szCountry;
}
__________________