BANNED
|
07-15-2012
, 03:10
Country on name
|
#1
|
Hey...
can anybody make new country on name and make it just on chat like country chat
i don't want it full country but i need it part of country name like : UZ , PS not full name
Country on name code : (part of name)
PHP Code:
#include < amxmodx > #include < geoip > #define VERSION "1.0" new g_country[ 33 ][ 5 ]; public plugin_init( ) { register_plugin( "Country name - Abo Zanih", VERSION, "......" ); register_cvar( "country_on_name", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); set_cvar_string( "country_on_name", VERSION ); } public client_putinserver( id ) { new ip[ 32 ], country[ 3 ]; get_user_ip( id, ip, charsmax( ip ) ); if( geoip_code2_ex( ip, country ) ) { format( g_country[ id ], charsmax( g_country[ ] ), "[%s]", country ); } else { g_country[ id ] = "??"; } } public client_disconnect( id ) { g_country[ id ][ 0 ] = EOS; } #define has_good_name(%1) ( %1[ 0 ] == '[' && %1[ 3 ] == ']' && ( %1[ 1 ] == g_country[ id ][ 1 ] || %1[ 1 ] == '?' ) && ( %1[ 2 ] == g_country[ id ][ 2 ] || %1[ 2 ] == '?' ) ) public client_infochanged( id ) { if( g_country[ id ][ 0 ] ) { new newname[ 32 ]; get_user_info( id, "name", newname, charsmax( newname ) ); if( !has_good_name( newname ) ) { format( newname, charsmax( newname ), "%s %s", g_country[ id ], newname ); set_user_info( id, "name", newname ); return PLUGIN_HANDLED; } } return PLUGIN_CONTINUE; }
Country chat with full name :
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <geoip> #define PLUGIN_NAME "country chat" #define PLUGIN_VERSION "1.1" #define PLUGIN_AUTHOR "K.K.Lv" new players[33][32] new num[33] public plugin_init() { register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR) register_clcmd("say", "hook_say") register_clcmd("say_team", "hook_team_say") } public hook_say(id) { new chat[192] read_args(chat, 191) remove_quotes(chat) new name[32], userip[16], usercountry[46], message[256] get_user_name(id, name, 31) get_user_ip(id, userip, 15, 1) geoip_country(userip, usercountry, 45) new CsTeams:userteam =cs_get_user_team(id) if(equal(chat, "")) return PLUGIN_HANDLED if (is_user_alive(id)) { format(message, 255, "^x04[%s]^x03%s^x01: %s", usercountry, name, chat) color_chat(0, id, message) } else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR) { format(message, 255, "^x04[%s]^x01*DEAD*^x03%s^x01: %s", usercountry, name, chat) color_chat(0, id, message) } else { format(message, 255, "^x04[%s]^x01*SPEC*^x03%s^x01: %s", usercountry, name, chat) color_chat(0, id, message) } return PLUGIN_HANDLED } public hook_team_say(id) { new chat[192] read_args(chat, 191) remove_quotes(chat) new name[32], userip[16], usercountry[46], message[256], team[32] get_user_name(id, name, 31) get_user_ip(id, userip, 15, 1) geoip_country(userip, usercountry, 45) if(equal(chat, "")) return PLUGIN_HANDLED new CsTeams:userteam =cs_get_user_team(id) if (userteam == CS_TEAM_T) { get_players(players[id], num[id], _, "TERRORIST") team = "(Terrorist)" } else if (userteam == CS_TEAM_CT) { get_players(players[id], num[id], _, "CT") team = "(Counter-Terrorist)" } else { get_players(players[id], num[id], _, "SPECTATOR") team = "(Spectator)" } for (new a = 0; a < num[id]; ++a) { new i = players[id][a] if (is_user_alive(id)) { format(message, 255, "^x04[%s]^x01%s^x03%s^x01: %s", usercountry, team, name, chat) color_chat(i, id, message) } else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR) { format(message, 255, "^x04[%s]^x01*DEAD*%s^x03%s^x01: %s", usercountry, team, name, chat) color_chat(i, id, message) } else { format(message, 255, "^x04[%s]^x01%s^x03%s^x01: %s", usercountry, team, name, chat) color_chat(i, id, message) } } return PLUGIN_HANDLED } public color_chat(playerid, colorid, message[]) { message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0, 0, 0}, playerid) write_byte(colorid) write_string(message) message_end() } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par } */
thanks
|
|