|
Senior Member
Join Date: Feb 2011
Location: Limbo City
|

02-14-2011
, 08:17
Necesito ayuda con mi ZP Levels
|
#1
|
Hola a todos soy nuevo en el foro y necesito ayuda que pasa con mi zp tiene un bug en los ammo packs
bueno el bug es que yo mato un zombie y yo en la cfg puse que los zombies dieran al ser matados 5 ammopacks pero cuando el humano mata al zombie en el hud de "- vida: 1000.." sale en 5 siempre porque ? se supone que si tenía 5 ammopacks por default en el juego ya serian 10 por el zombie que maté, intenté acomadar en el showhud aver si era ahii pero sigue igual.
gracias de antemano !!!
dejo source code del Show Hud aver si me ayudan en algo que habré echo mal!
PHP Code:
// Spectating someone else? if (id != ID_SHOWHUD) { static name[32] get_user_name(id, name, sizeof name - 1) // Show name, health, class, and ammo packs set_hudmessage(255, 255, 255, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "- Level: %d ^n- %L %s^n- HP: %d ^n- %L %s ^n- %L %d", ID_SHOWHUD, "SPECTATING", Get_PlayerLevel(id), name, pev(id, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id], Get_AmmoPacks_per_Level(id)) } else { // Show health, class and ammo packs set_hudmessage(g_hud_color[id][0], g_hud_color[id][1], g_hud_color[id][2], HUD_STATS_X[id], HUD_STATS_Y[id], HUD_STATS_T[id], 2.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "- Level: %d ^n- %L: %d ^n- %L %s ^n- %L %d ^n- Zombies matados: %d ^n- Humanos matados: %d ^n- Infectados: %d", Get_PlayerLevel(ID_SHOWHUD), id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], Get_AmmoPacks_per_Level(ID_SHOWHUD), Zombies[id], Humanos[id], Infectados[id]) } }
y este es la restriccion de clases de zombies
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, "\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 < min(WPN_STARTID+7, WPN_MAXIDS); weap++) { if(Get_PlayerLevel(id) >= PrimaryWeaponLevel[weap]) { len += formatex(menu[len], sizeof menu - 1 - len, "\r%d. \w%s \y[Disponible]^n", weap-WPN_STARTID+1, WEAPONNAMES[get_weaponid(g_primary_items[weap])]) } else { len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. \w%s \r[Nivel %d]^n", weap-WPN_STARTID+1, WEAPONNAMES[get_weaponid(g_primary_items[weap])], PrimaryWeaponLevel[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.\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 Menu 2 show_menu_buy2(id) { if(is_user_connected(id)) { static menu[999], len, weap len = 0 // Title len += formatex(menu[len], sizeof menu - 1 - len, "\y%L^n", id, "MENU_BUY2_TITLE") // 1-6. Weapon List for (weap = 0; weap < sizeof g_secondary_items; weap++) { if(Get_PlayerLevel(id) >= SecondaryWeaponLevel[weap]) { len += formatex(menu[len], sizeof menu - 1 - len, "^n\r%d. \w%s \y[Disponible]^n", weap+1, WEAPONNAMES[get_weaponid(g_secondary_items[weap])]) } else { len += formatex(menu[len], sizeof menu - 1 - len, "^n\d%d. \w%s \r[Nivel %d]^n", weap+1, WEAPONNAMES[get_weaponid(g_secondary_items[weap])], SecondaryWeaponLevel[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.\w %L", id, "MENU_EXIT") show_menu(id, KEYSMENU, menu, -1, "Buy Menu 2") } }
PHP Code:
// Zombie Class Menu public show_menu_zclass(id) { // Player disconnected if (!is_user_connected(id)) return; // Bots pick their zombie class randomly if (is_user_bot(id)) { g_zombieclassnext[id] = random_num(0, g_zclass_i - 1) return; } static menu[999], len, class len = 0 // Title len += formatex(menu[len], sizeof menu - 1 - len, "\y%L \r[%d-%d]^n^n", id, "MENU_ZCLASS_TITLE", ZCLASSES_STARTID+1, min(ZCLASSES_STARTID+7, g_zclass_i)) // 1-7. Class List for (class = ZCLASSES_STARTID; class < min(ZCLASSES_STARTID+7, g_zclass_i); class++) { if (Get_PlayerLevel(id) >= g_zclass_lvl[class]) { if (class == g_zombieclassnext[id]) len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. %s %s^n", class-ZCLASSES_STARTID+1, g_zclass_name[class], g_zclass_info[class]) else len += formatex(menu[len], sizeof menu - 1 - len, "\r%d.\w %s\y %s^n", class-ZCLASSES_STARTID+1, g_zclass_name[class], g_zclass_info[class]) } else len += formatex(menu[len], sizeof menu - 1 - len, "\r%d.\d %s %s\r (Nivel Requerido: %d)^n", class-ZCLASSES_STARTID+1, g_zclass_name[class], g_zclass_info[class], g_zclass_lvl[class]) } // 8. Back - 9. Next - 0. Exit len += formatex(menu[len], sizeof menu - 1 - len, "^n\r8.\w %L^n\r9.\w %L^n^n\r0.\w %L", id, "MENU_BACK", id, "MENU_NEXT", id, "MENU_EXIT") show_menu(id, KEYSMENU, menu, -1, "Zombie Class Menu") }
este del menu handlers
PHP Code:
// Buy Menu 1 public menu_buy1(id, key) { if(is_user_connected(id)) { // Zombies or survivors get no guns if (g_zombie[id] || g_survivor[id] || !is_user_alive(id)) return PLUGIN_HANDLED; // Special keys / weapon list exceeded if (key >= MENU_KEY_AUTOSELECT || WPN_SELECTION >= WPN_MAXIDS) { switch (key) { case MENU_KEY_AUTOSELECT: // toggle auto select { WPN_AUTO_ON = 1 - WPN_AUTO_ON } case MENU_KEY_NEXT: // next/back { if (WPN_STARTID+7 < WPN_MAXIDS) WPN_STARTID += 7 else WPN_STARTID = 0 } case MENU_KEY_EXIT: // exit { return PLUGIN_HANDLED; } } // Show buy menu again show_menu_buy1(id) return PLUGIN_HANDLED; } if(Get_PlayerLevel(id) < PrimaryWeaponLevel[WPN_SELECTION]) { show_menu_buy1(id) client_print(id, print_chat, "Necesitas ser Nivel mas alto para usar esta arma (Nivel Requerido %d)", PrimaryWeaponLevel[WPN_SELECTION]) return PLUGIN_HANDLED } // Store selected weapon id WPN_AUTO_PRI = WPN_SELECTION // Buy primary weapon buy_primary_weapon(id, WPN_AUTO_PRI) // Show pistols menu show_menu_buy2(id) } return PLUGIN_HANDLED; }
// Buy Primary Weapon buy_primary_weapon(id, selection) { // Drop previous weapons drop_weapons(id, 1) drop_weapons(id, 2) // Strip off from weapons fm_strip_user_weapons(id) fm_give_item(id, "weapon_knife") // Get weapon index static weaponid weaponid = get_weaponid(g_primary_items[selection]) // Give the new weapon fm_give_item(id, g_primary_items[selection]) fm_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid]) // Weapons bought g_canbuy[id] = false // Give additional items static i for (i = 0; i < sizeof g_additional_items; i++) fm_give_item(id, g_additional_items[i]) }
// Buy Menu 2 public menu_buy2(id, key) { // Zombies or survivors get no guns if (g_zombie[id] || g_survivor[id] || !is_user_alive(id)) return PLUGIN_HANDLED; // Special keys / weapon list exceeded if (key >= sizeof g_secondary_items) { // Toggle autoselect if (key == MENU_KEY_AUTOSELECT) WPN_AUTO_ON = 1 - WPN_AUTO_ON // Reshow menu unless user exited if (key != MENU_KEY_EXIT) show_menu_buy2(id) return PLUGIN_HANDLED; } if(Get_PlayerLevel(id) < SecondaryWeaponLevel[key]) { show_menu_buy2(id) client_print(id, print_chat, "Necesitas ser Nivel mas alto para usar esta arma (Nivel Requerido %d)", SecondaryWeaponLevel[key]) return PLUGIN_HANDLED } // Store selected weapon WPN_AUTO_SEC = key // Drop secondary gun again, in case we picked another (bugfix) drop_weapons(id, 2) // Get weapon index static weaponid weaponid = get_weaponid(g_secondary_items[key]) // Give the new weapon with full ammo fm_give_item(id, g_secondary_items[key]) fm_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid]) return PLUGIN_HANDLED;
pd: si el problema no es ahii avisen para dejar el sma aver si serian amables de verlo
Last edited by Sidix; 02-14-2011 at 08:25.
|
|