|
在论坛上找了个显示IP地址的插件,发现在DOD服务器中无法显示出中文如下:
Client "player"comes from (湖南电信)
我试着修改了一些插件中的英文不知道对不对,本人第一次学修改插件,请各位大哥别打击我。
/* IPSeeker Client Info */
#include <amxmodx>
#include <ipseeker>
new const PLUGIN_NAME[] = "IPSeeker Client Info"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "KinSprite"
new g_saytext
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
g_saytext = get_user_msgid("SayText")
}
public plugin_cfg()
{
new ip[32]
get_cvar_string("net_address", ip, 31)
new address[64]
ipseeker(ip, ipseek_all, address, 63, 0)
server_print(" 你的服务器:地址是 ^"%s^" (in ANSI)^n", address)
//log_to_file("all.txt", address)
ipseeker(ip, ipseek_all, address, 63, 1)
server_print(" 你的服务器:地址是 ^"%s^" (in UTF-8)^n", address)
//log_to_file("all8.txt", address)
new area[64]
ipseeker2(ip, address, 63, 0, area, 63, 0)
server_print(" 你的服务器:国家是 is ^"%s^", area is ^"%s^" (in ANSI)^n", address, area)
//log_to_file("country.txt", address)
//log_to_file("area.txt", area)
ipseeker2(ip, address, 63, 1, area, 63, 1)
server_print(" 你的服务器:国家是^"%s^", area is ^"%s^" (in UTF-8)^n", address, area)
//log_to_file("country8.txt", address)
//log_to_file("area8.txt", area)
}
public client_disconnect(id)
{
if (task_exists(id))
remove_task(id)
return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
if (!is_user_bot(id))
set_task(3.2, "show_claddrInfo", id)
return PLUGIN_CONTINUE
}
public show_claddrInfo(id)
{
new name[32], ip[32], addr[128]
get_user_name(id, name, 31)
get_user_ip(id, ip, 31, 1)
ipseeker(ip, ipseek_all, addr, 128, 1)
new text[128]
format(text, 127, "湘西土匪提示 ^"%s^" 进入服务器 ^"%s^"", name, addr)
show_green_text_all(text);
}
new showText[256];
public show_green_text_all(text[]){
format(showText[1], 254, text)
showText[0] = 4 // green color
new players[32], plNum
get_players(players, plNum, "c")
for (new i = 0; i < plNum; ++i)
{
text_message(players, showText)
}
}
stock text_message(id, message[])
{
message_begin(MSG_ONE, g_saytext, {0,0,0}, id)
write_byte(id)
write_string(message)
message_end()
} |
|