|
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
|

02-19-2011
, 12:34
Re: [ZP] Problema al restringir armas
|
#1
|
Y no, se repite dos veces.
PHP Code:
// Buy Menu 1 public show_menu_buy1(taskid) { // Get player id static id (taskid > g_maxplayers) ? (id = ID_SPAWN) : (id = taskid); // Zombies or survivors get no guns if (g_zombie[id] || g_survivor[id] || !is_user_alive(id)) return; // Bots pick their weapons randomly if (is_user_bot(id)) { buy_primary_weapon(id, random_num(0, sizeof g_primary_items - 1)) menu_buy2(id, random_num(0, sizeof 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[999], len, weap len = 0 // Title len += formatex(menu[len], sizeof menu - 1 - len, "\r%L \y[%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 < min(WPN_STARTID+7, WPN_MAXIDS); weap++) { if(g_level[id] >= g_levelprimary[weap]) len += formatex(menu[len], sizeof menu - 1 - len, "\r%d.\w %s \y[Level %d]^n", weap-WPN_STARTID+1, WEAPONNAMES[get_weaponid(g_primary_items[weap])], g_levelprimary[weap]) else len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. %s [Level %d]^n", weap-WPN_STARTID+1, WEAPONNAMES[get_weaponid(g_primary_items[weap])], g_levelprimary[weap]) } // 8. Auto Select len += formatex(menu[len], sizeof menu - 1 - 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], sizeof menu - 1 - len, "^n^n\r9.\y %L/%L^n^n\r0.\y %L", id, "MENU_NEXT", id, "MENU_BACK", id, "MENU_EXIT") show_menu(id, KEYSMENU, menu, -1, "Buy Menu 1") }
// Buy Menu 2 show_menu_buy2(id) { static menu[999], len, weap len = 0 // Title len += formatex(menu[len], sizeof menu - 1 - len, "\r%L^n", id, "MENU_BUY2_TITLE") // 1-6. Weapon List for (weap = 0; weap < sizeof g_secondary_items; weap++) { if(g_level[id] >= g_levelsecondary[weap]) len += formatex(menu[len], sizeof menu - 1 - len, "^n\r%d.\w %s \y[Level %d]", weap+1, WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecondary[weap]) else len += formatex(menu[len], sizeof menu - 1 - len, "^n\d%d. %s [Level %d]", weap+1, WEAPONNAMES[get_weaponid(g_secondary_items[weap])], g_levelsecondary[weap]) } // 8. Auto Select len += formatex(menu[len], sizeof menu - 1 - len, "^n^n\r8.\w %L \y[%L]", id, "MENU_AUTOSELECT", id, (WPN_AUTO_ON) ? "MOTD_ENABLED" : "MOTD_DISABLED") // 0. Exit len += formatex(menu[len], sizeof menu - 1 - len, "^n^n\r0.\y %L", id, "MENU_EXIT") show_menu(id, KEYSMENU, menu, -1, "Buy Menu 2") }
Indetado y arreglado.
Problem, pajero?
__________________
Quote:
Originally Posted by joropito
You're right Metalicross
|
|
|