下面是引用 上帝的右手^^ 於 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嗎,還是我眼殘寫錯教學