下面是引用 上帝的右手^^ 于 2010-02-20 20:42 发表的 求Zombie的取消大枪选择的方法:
我在zombie_plague40.sma搜寻
// buy menu 1
里面的len = 0
改成len = 1
// buy menu 1
不是大枪的选单吗?
为什么会把手枪的选单也取消掉
求一个方法净把大枪选单取消...
你好,我那个帖的作者
复制程式
// Buy Menu 1
public show_menu_buy1(taskid)
{
// Get player's id
static id
(taskid > g_maxplayers) ? (id = ID_SPAWN) : (id = taskid);
// Zombies or survivors get no guns
if (!g_isalive[id] || g_zombie[id] || g_survivor[id])
return;
// Bots pick their weapons randomly / Random weapons setting enabled
if (get_pcvar_num(cvar_randweapons) || g_isbot[id])
{
buy_primary_weapon(id, random_num(0, ArraySize(g_primary_items) - 1))
menu_buy2(id, random_num(0, ArraySize(g_secondary_items) - 1))
return;
}
// Automatic selection enabled for player and menu called on spawn event
if (WPN_AUTO_ON && taskid > g_maxplayers)
{
buy_primary_weapon(id, WPN_AUTO_PRI)
menu_buy2(id, WPN_AUTO_SEC)
return;
}
static menu[300], len, weap, maxloops
len = 0
maxloops = min(WPN_STARTID+7, WPN_MAXIDS)
// Title
len += formatex(menu[len], charsmax(menu) - len, "\y%L \r[%d-%d]^n^n", id, "MENU_BUY1_TITLE", WPN_STARTID+1, min(WPN_STARTID+7, WPN_MAXIDS))
// 1-7. Weapon List
for (weap = WPN_STARTID; weap < maxloops; weap++)
len += formatex(menu[len], charsmax(menu) - len, "\r%d.\w %s^n", weap-WPN_STARTID+1, WEAPONNAMES[ArrayGetCell(g_primary_weaponids, weap)])
// 8. Auto Select
len += formatex(menu[len], charsmax(menu) - len, "^n\r8.\w %L \y[%L]", id, "MENU_AUTOSELECT", id, (WPN_AUTO_ON) ? "MOTD_ENABLED" : "MOTD_DISABLED")
// 9. Next/Back - 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "^n^n\r9.\w %L/%L^n^n\r0.\w %L", id, "MENU_NEXT", id, "MENU_BACK", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "Buy Menu 1")
}
这个的确是购买主枪的地方,楼主你写错了Buy menu2吗,还是我眼残写错教学