Veteran Member
Join Date: Oct 2011
Location: banned country
|
10-24-2011
, 19:18
Re: [ZP] Crear Niveles por AmmoPacks [Forma Completa y Buena]
|
#158
|
perdón por revivir pero tenia una duda y quería saber si se podía solucionar..
en la parte de buy_extra_item, tengo un problema. Se que este Tutorial fue echo para ZP 4.2, yo estoy usando ZP 4.3 y con el tutorial pude hacer los levels, pero cuando compro un item extra no me saca el level. En el tutorial dice que cambiar en esa parte pero si lo cambio me tira error y si no lo cambio, me compra el item extra, me saca los AP pero no me quita el level, así que quería saber si se puede hacer algo.
Dejo el code
PHP Code:
buy_extra_item(id, itemid, ignorecost = 0) { // Retrieve item's team static team team = ArrayGetCell(g_extraitem_team, itemid) // Check for team/class specific items if ((g_zombie[id] && !g_nemesis[id] && !(team & ZP_TEAM_ZOMBIE)) || (!g_zombie[id] && !g_survivor[id] && !(team & ZP_TEAM_HUMAN)) || (g_nemesis[id] && !(team & ZP_TEAM_NEMESIS)) || (g_survivor[id] && !(team & ZP_TEAM_SURVIVOR))) { zp_colored_print(id, "^x04[ZP]^x01 %L", id, "CMD_NOT") return; } // Check for unavailable items if ((itemid == EXTRA_NVISION && !get_pcvar_num(cvar_extranvision)) || (itemid == EXTRA_ANTIDOTE && (!get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit))) || (itemid == EXTRA_MADNESS && (!get_pcvar_num(cvar_extramadness) || g_madnesscounter >= get_pcvar_num(cvar_madnesslimit))) || (itemid == EXTRA_INFBOMB && (!get_pcvar_num(cvar_extrainfbomb) || g_infbombcounter >= get_pcvar_num(cvar_infbomblimit))) || (itemid >= EXTRA_WEAPONS_STARTID && itemid <= EXTRAS_CUSTOM_STARTID-1 && !get_pcvar_num(cvar_extraweapons))) { zp_colored_print(id, "^x04[ZP]^x01 %L", id, "CMD_NOT") return; } // Check for hard coded items with special conditions if ((itemid == EXTRA_ANTIDOTE && (g_endround || g_swarmround || g_nemround || g_survround || g_plagueround || fnGetZombies() <= 1 || (get_pcvar_num(cvar_deathmatch) && !get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() == 1))) || (itemid == EXTRA_MADNESS && g_nodamage[id]) || (itemid == EXTRA_INFBOMB && (g_endround || g_swarmround || g_nemround || g_survround || g_plagueround))) { zp_colored_print(id, "^x04[ZP]^x01 %L", id, "CMD_NOT_CANTUSE") return; } // Ignore item's cost? if (!ignorecost) { // Check that we have enough ammo packs if (g_ammopacks[id] < ArrayGetCell(g_extraitem_cost, itemid)) { zp_colored_print(id, "^x04[ZP]^x01 %L", id, "NOT_ENOUGH_AMMO") return; } // Deduce item cost g_ammopacks[id] -= ArrayGetCell(g_extraitem_cost, itemid) } // Check which kind of item we're buying switch (itemid) { case EXTRA_NVISION: // Night Vision { g_nvision[id] = true if (!g_isbot[id]) { g_nvisionenabled[id] = true // Custom nvg? if (get_pcvar_num(cvar_customnvg)) { remove_task(id+TASK_NVISION) set_task(0.1, "set_user_nvision", id+TASK_NVISION, _, _, "b") } else set_user_gnvision(id, 1) } else cs_set_user_nvg(id, 1) } case EXTRA_ANTIDOTE: // Antidote { // Increase antidote purchase count for this round g_antidotecounter++ humanme(id, 0, 0) } case EXTRA_MADNESS: // Zombie Madness { // Increase madness purchase count for this round g_madnesscounter++ g_nodamage[id] = true set_task(0.1, "zombie_aura", id+TASK_AURA, _, _, "b") set_task(get_pcvar_float(cvar_madnessduration), "madness_over", id+TASK_BLOOD) static sound[64] ArrayGetString(zombie_madness, random_num(0, ArraySize(zombie_madness) - 1), sound, charsmax(sound)) emit_sound(id, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM) } case EXTRA_INFBOMB: // Infection Bomb { // Increase infection bomb purchase count for this round g_infbombcounter++ // Already own one if (user_has_weapon(id, CSW_HEGRENADE)) { // Increase BP ammo on it instead cs_set_user_bpammo(id, CSW_HEGRENADE, cs_get_user_bpammo(id, CSW_HEGRENADE) + 1) // Flash ammo in hud message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id) write_byte(AMMOID[CSW_HEGRENADE]) // ammo id write_byte(1) // ammo amount message_end() // Play clip purchase sound emit_sound(id, CHAN_ITEM, sound_buyammo, 1.0, ATTN_NORM, 0, PITCH_NORM) return; // stop here } // Give weapon to the player fm_give_item(id, "weapon_hegrenade") } default: { if (itemid >= EXTRA_WEAPONS_STARTID && itemid <= EXTRAS_CUSTOM_STARTID-1) // Weapons { // Get weapon's id and name static weaponid, wname[32] ArrayGetString(g_extraweapon_items, itemid - EXTRA_WEAPONS_STARTID, wname, charsmax(wname)) weaponid = cs_weapon_name_to_id(wname) // If we are giving a primary/secondary weapon if (MAXBPAMMO[weaponid] > 2) { // Make user drop the previous one if ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM) drop_weapons(id, 1) else drop_weapons(id, 2) // Give full BP ammo for the new one ExecuteHamB(Ham_GiveAmmo, id, MAXBPAMMO[weaponid], AMMOTYPE[weaponid], MAXBPAMMO[weaponid]) } // If we are giving a grenade which the user already owns else if (user_has_weapon(id, weaponid)) { // Increase BP ammo on it instead cs_set_user_bpammo(id, weaponid, cs_get_user_bpammo(id, weaponid) + 1) // Flash ammo in hud message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id) write_byte(AMMOID[weaponid]) // ammo id write_byte(1) // ammo amount message_end() // Play clip purchase sound emit_sound(id, CHAN_ITEM, sound_buyammo, 1.0, ATTN_NORM, 0, PITCH_NORM) return; // stop here } // Give weapon to the player fm_give_item(id, wname) } else // Custom additions { // Item selected forward ExecuteForward(g_fwExtraItemSelected, g_fwDummyResult, id, itemid); // Item purchase blocked, restore buyer's ammo packs if (g_fwDummyResult >= ZP_PLUGIN_HANDLED && !ignorecost) g_ammopacks[id] += ArrayGetCell(g_extraitem_cost, itemid) } } } }
Disculpen por revivir
__________________
Last edited by rak; 10-24-2011 at 19:21.
Reason: error de ortografía
|
|