搜索
查看: 2052|回复: 2

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

[复制链接]
发表于 2008-3-25 03:44:52 | 显示全部楼层 |阅读模式 来自 中国–湖南–怀化
在论坛上找了个显示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()
}
 楼主| 发表于 2008-3-25 03:46:18 | 显示全部楼层 来自 中国–湖南–怀化

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

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

使用道具 举报

发表于 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中就可以编译成功了。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表