【求助】关于赌博插件的菜单汉化
大家好,我前几天到amxmodx下了一个赌博插件,这个插件是当本局CTT 各剩一人时显示投注菜单,然后让死去的玩家进行投注的,下回来后我试着汉化,所有的client_print 语句都可以成功汉化,并正确运行, 最后剩下那个投注菜单无法汉化,一汉化就会出现异常。这是未汉化时的源程序菜单:
http://www.kaneta.cn/cstrike/source.bmp
经本人汉化后的菜单是:
http://www.kaneta.cn/cstrike/modifed.bmp
问题出现了:
原本的菜单出现时,所有用户都可以按1,2,3,4,5,6,0 进行选择,投注成功。
但经过汉化后,当用户按任何一个1至6的按键,菜单就会即时退出,没注额无任何变化,投注失败
我想这应该是我不会得汉化菜单的原故,望前辈指导!万分感谢。
源程序中,菜单部分应该是这段:
//------------------------------------------------------------------------------------------------------
new menuBody, flags = MENUBUTTON1|MENUBUTTON2|MENUBUTTON0, money = cs_get_user_money(id)
new t_hp = get_user_health(g_t), ct_hp = get_user_health(g_ct), t_armour = get_user_armor(g_t), ct_armour = get_user_armor(g_ct)
new len = format(menuBody, 511, "It's \y%s\w vs. \y%s\w! Place your bets! Who will win?^n^n1. %s (HP: %d, Armour: %d)^n2. %s (HP: %d, Armour: %d)^n^nCurrent bet: $\y%d\w^n", g_names, g_names, g_names, t_hp, t_armour, g_names, ct_hp, ct_armour, g_betamount)
if (g_pot > 0)
len += format(menuBody, 511 - len, "^nCurrent pot is $\y%d\w^n", g_pot)
new const DEFAULTBET = get_cvar_num(CVAR_DEFAULTBET)
// +1x
if (money >= g_betamount + DEFAULTBET) {
flags |= MENUBUTTON3
len += format(menuBody, 511 - len, "\w")
}
else
len += format(menuBody, 511 - len, "\d")
len += format(menuBody, 511 - len, "3. Raise bet by $%d^n", DEFAULTBET)
// +10x
if (money >= g_betamount + DEFAULTBET * 10) {
flags |= MENUBUTTON4
len += format(menuBody, 511 - len, "\w")
}
else
len += format(menuBody, 511 - len, "\d")
len += format(menuBody, 511 - len, "4. Raise bet by $%d^n", DEFAULTBET * 10)
// -1x
if (g_betamount - DEFAULTBET >= DEFAULTBET) {
flags |= MENUBUTTON5
len += format(menuBody, 511 - len, "\w")
}
else
len += format(menuBody, 511 - len, "\d")
len += format(menuBody, 511 - len, "5. Lower bet by $%d^n", DEFAULTBET)
// -10x
if (g_betamount - DEFAULTBET * 10 >= DEFAULTBET) {
flags |= MENUBUTTON6
len += format(menuBody, 511 - len, "\w")
}
else
len += format(menuBody, 511 - len, "\d")
len += format(menuBody, 511 - len, "6. Lower bet by $%d^n\w", DEFAULTBET * 10)
len += format(menuBody, 511 - len, "^n0. I'm not a gambler")
show_menu(id, flags, menuBody)
//client_print(id, print_chat, "Showing menu to you")
}
//-----------------------------------------------------------------------------------------------------
原下载地址是: http://www.amxmodx.org/forums/viewtopic.php?t=2902&postdays=0&postorder=asc&start=0
源码在附件上: 我顶,就不信没高手! g_betmenu = register_menuid("It's")
要和这里符合
new len = format(menuBody, 511, "It's \y%s ....... 牛牛,楼主可能看不到你的回答..... Post by BoeZombie
牛牛,楼主可能看不到你的回答.....
我知道,但他很快就能看到了,是不是 呵呵,对对 什么?! 我昏哦,不可以这样歧视新人。。。 看不到看不到,惨呀,好可怜。不过还是多谢各位的帮助关心。 Post by eddiefish1
看不到看不到,惨呀,好可怜。不过还是多谢各位的帮助关心。 你多发两贴就能看见了