daredevil 发表于 2008-3-25 03:44:52

第一次学修改SMA,请给予帮助

在论坛上找了个显示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
get_cvar_string("net_address", ip, 31)
new address
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
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, ip, addr
get_user_name(id, name, 31)
get_user_ip(id, ip, 31, 1)
ipseeker(ip, ipseek_all, addr, 128, 1)

new text
format(text, 127, "湘西土匪提示 ^"%s^" 进入服务器 ^"%s^"", name, addr)

show_green_text_all(text);
}
new showText;
public show_green_text_all(text[]){
format(showText, 254, text)
showText = 4 // green color

new players, 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()
}

daredevil 发表于 2008-3-25 03:46:18

回复: 第一次学修改SMA,请给予帮助

使用compile无法将我修改的sam文件转成amxx文件,应该怎么弄,请各位大哥们帮忙。

lala21 发表于 2008-4-10 13:49:47

回复: 第一次学修改SMA,请给予帮助

Post by daredevil
使用compile无法将我修改的sam文件转成amxx文件,应该怎么弄,请各位大哥们帮忙。

这个要用到UltraEdit-32来编辑了,方法是:用UltraEdit-32打开该compile.exe无法正确编译的sam文件,另存为->选格式->utf-8 无ROM,点保存后即可。最后,将修改过的sam文件,再次拖到compile中就可以编译成功了。
页: [1]
查看完整版本: 第一次学修改SMA,请给予帮助