|
大家好,我前几天到amxmodx下了一个赌博插件,这个插件是当本局CT T 各剩一人时显示投注菜单,然后让死去的玩家进行投注的,下回来后我试着汉化,所有的client_print 语句都可以成功汉化,并正确运行, 最后剩下那个投注菜单无法汉化,一汉化就会出现异常。
这是未汉化时的源程序菜单:
经本人汉化后的菜单是:
问题出现了:
原本的菜单出现时,所有用户都可以按1,2,3,4,5,6,0 进行选择,投注成功。
但经过汉化后,当用户按任何一个1至6的按键,菜单就会即时退出,没注额无任何变化,投注失败
我想这应该是我不会得汉化菜单的原故,望前辈指导!万分感谢。
源程序中,菜单部分应该是这段:
//------------------------------------------------------------------------------------------------------
new menuBody[512], 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[TEAM_T], g_names[TEAM_CT], g_names[TEAM_T], t_hp, t_armour, g_names[TEAM_CT], ct_hp, ct_armour, g_betamount[id])
if (g_pot > 0)
len += format(menuBody[len], 511 - len, "^nCurrent pot is $\y%d\w^n", g_pot)
new const DEFAULTBET = get_cvar_num(CVAR_DEFAULTBET)
// +1x
if (money >= g_betamount[id] + DEFAULTBET) {
flags |= MENUBUTTON3
len += format(menuBody[len], 511 - len, "\w")
}
else
len += format(menuBody[len], 511 - len, "\d")
len += format(menuBody[len], 511 - len, "3. Raise bet by $%d^n", DEFAULTBET)
// +10x
if (money >= g_betamount[id] + DEFAULTBET * 10) {
flags |= MENUBUTTON4
len += format(menuBody[len], 511 - len, "\w")
}
else
len += format(menuBody[len], 511 - len, "\d")
len += format(menuBody[len], 511 - len, "4. Raise bet by $%d^n", DEFAULTBET * 10)
// -1x
if (g_betamount[id] - DEFAULTBET >= DEFAULTBET) {
flags |= MENUBUTTON5
len += format(menuBody[len], 511 - len, "\w")
}
else
len += format(menuBody[len], 511 - len, "\d")
len += format(menuBody[len], 511 - len, "5. Lower bet by $%d^n", DEFAULTBET)
// -10x
if (g_betamount[id] - DEFAULTBET * 10 >= DEFAULTBET) {
flags |= MENUBUTTON6
len += format(menuBody[len], 511 - len, "\w")
}
else
len += format(menuBody[len], 511 - len, "\d")
len += format(menuBody[len], 511 - len, "6. Lower bet by $%d^n\w", DEFAULTBET * 10)
len += format(menuBody[len], 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/vi ... der=asc&start=0
源码在附件上: |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|