[PEDIDO] Bloqueando M2 no ZP 5.0 Hitskin_logo Hitskin.com

Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o temaVoltar para a ficha do tema

Zplague

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Seu portal de Zombie Plague no Brasil

Zumbis Online

Últimos assuntos

» [ANÚNCIO] Alguem vivo ai?
por Eclipse 17/9/2024, 6:39 pm

» The Fen1xS CLan | Zombie Plague | [XP/LEVELS] #2024
por hevy 5/7/2024, 8:28 pm

»
por Eclipse 29/2/2024, 12:30 am

» [Plugin] /vm Com Status
por Isr7 4/6/2023, 3:24 pm

» Alguém pra manter um servidor comigo?
por Isr7 3/6/2023, 4:52 pm

» Alguém querendo criar um servidor de zp? eu pago a host quem quiser deixar o discord ai Isr7#6920
por Isr7 3/6/2023, 3:18 pm

» PEDIDO: Multijump pros VIP
por Madness 15/3/2023, 3:44 pm

» [ZP] Modo padre para 5.0
por XperitosEspetinho123 15/7/2022, 3:31 pm

» [KZ] Servidores de cs 1.6
por [Dk]Serial-Killer 7/5/2022, 4:12 am

» [PLUGIN BY SKVD & WILLIAN] SHOP DE FANTASIAS
por dushowW 23/7/2020, 5:44 pm

Os membros mais ativos da semana

Nenhum usuário

Frases filosóficas Zplague:

....

Google Adsense

Estatísticas

Os nossos membros postaram um total de 38140 mensagens em 6680 assuntos

Temos 2796 usuários registrados

O último membro registrado é zmplugins - Henrique


4 participantes

    [PEDIDO] Bloqueando M2 no ZP 5.0

    PRO DARK
    PRO DARK
    Humano


    Masculino Número de Mensagens : 126
    Ammo Packs : 4504
    Honra : 13
    Data de inscrição : 04/08/2012

    [PEDIDO] Bloqueando M2 no ZP 5.0 Empty [PEDIDO] Bloqueando M2 no ZP 5.0

    Mensagem por PRO DARK 11/6/2018, 12:19 pm

    Gostaria de bloquear acesso ao M2 antes do inicio do round para ZP 5.0, o Perfect até deu uma força mas ainda não está funcionando como deveria, APÓS começar o round o M2 continua bloqueado!

    O plugin zp50_items.sma está assim (não vou botar a sma toda, somente o que foi alterado, o restante é original do plugin)

    Código:
    #include <amxmodx>
    #include <fakemeta>
    #include <amx_settings_api>
    #include <zp50_colorchat>
    #include <zp50_core_const>
    #include <zp50_items_const>
    #include <zp50_gamemodes>

    // No items to display?
       if (zp_gamemodes_get_current() == ZP_NO_GAME_MODE)
       {
          zp_colored_print(id, "^1ESPERE O ROUND INICIAR...")
          menu_destroy(menuid)
          return;
       }

    OBS: Dessa forma compila normalmente, só que como já falei acima o plugin não reconhece que o round teve inicio e liberar o M2
    [Dk]Serial-Killer
    [Dk]Serial-Killer
    Humano


    Nick : SkillVonDragon
    Masculino Número de Mensagens : 191
    De Boa :D
    Ammo Packs : 3110
    Honra : 5
    Data de inscrição : 10/09/2016

    [PEDIDO] Bloqueando M2 no ZP 5.0 Empty Re: [PEDIDO] Bloqueando M2 no ZP 5.0

    Mensagem por [Dk]Serial-Killer 11/6/2018, 6:33 pm

    EU até tentaria te ajudar mas não mexo muito com 5.0
    [P]erfec[T] [S]cr[@]s[H]
    [P]erfec[T] [S]cr[@]s[H]
    Scripter


    Masculino Número de Mensagens : 564
    Jogador FODA Perfect Scrash entrou na zplague
    Ammo Packs : 4545
    Honra : 177
    Data de inscrição : 04/04/2013

    [PEDIDO] Bloqueando M2 no ZP 5.0 Empty Re: [PEDIDO] Bloqueando M2 no ZP 5.0

    Mensagem por [P]erfec[T] [S]cr[@]s[H] 11/6/2018, 11:31 pm

    Código:
    /*================================================================================
     
     --------------------------
     -*- [ZP] Items Manager -*-
     --------------------------
     
     This plugin is part of Zombie Plague Mod and is distributed under the
     terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
     
    ================================================================================*/

    #include <amxmodx>
    #include <fakemeta>
    #include <amx_settings_api>
    #include <zp50_colorchat>
    #include <zp50_core_const>
    #include <zp50_items_const>
    #include <zp50_gamemodes>

    // Extra Items file
    new const ZP_EXTRAITEMS_FILE[] = "zp_extraitems.ini"

    // CS Player PData Offsets (win32)
    const OFFSET_CSMENUCODE = 205

    #define MAXPLAYERS 32

    // For item list menu handlers
    #define MENU_PAGE_ITEMS g_menu_data[id]
    new g_menu_data[MAXPLAYERS+1]

    enum _:TOTAL_FORWARDS
    {
     FW_ITEM_SELECT_PRE = 0,
     FW_ITEM_SELECT_POST
    }
    new g_Forwards[TOTAL_FORWARDS]
    new g_ForwardResult

    // Items data
    new Array:g_ItemRealName
    new Array:g_ItemName
    new Array:g_ItemCost
    new g_ItemCount
    new g_AdditionalMenuText[32]

    public plugin_init()
    {
     register_plugin("[ZP] Items Manager", ZP_VERSION_STRING, "ZP Dev Team")
     
     register_clcmd("say /items", "clcmd_items")
     register_clcmd("say items", "clcmd_items")
     
     g_Forwards[FW_ITEM_SELECT_PRE] = CreateMultiForward("zp_fw_items_select_pre", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL)
     g_Forwards[FW_ITEM_SELECT_POST] = CreateMultiForward("zp_fw_items_select_post", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL)
    }

    public plugin_natives()
    {
     register_library("zp50_items")
     register_native("zp_items_register", "native_items_register")
     register_native("zp_items_get_id", "native_items_get_id")
     register_native("zp_items_get_name", "native_items_get_name")
     register_native("zp_items_get_real_name", "native_items_get_real_name")
     register_native("zp_items_get_cost", "native_items_get_cost")
     register_native("zp_items_show_menu", "native_items_show_menu")
     register_native("zp_items_force_buy", "native_items_force_buy")
     register_native("zp_items_menu_text_add", "native_items_menu_text_add")
     
     // Initialize dynamic arrays
     g_ItemRealName = ArrayCreate(32, 1)
     g_ItemName = ArrayCreate(32, 1)
     g_ItemCost = ArrayCreate(1, 1)
    }

    public native_items_register(plugin_id, num_params)
    {
     new name[32], cost = get_param(2)
     get_string(1, name, charsmax(name))
     
     if (strlen(name) < 1)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Can't register item with an empty name")
     return ZP_INVALID_ITEM;
     }
     
     new index, item_name[32]
     for (index = 0; index < g_ItemCount; index++)
     {
     ArrayGetString(g_ItemRealName, index, item_name, charsmax(item_name))
     if (equali(name, item_name))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Item already registered (%s)", name)
     return ZP_INVALID_ITEM;
     }
     }
     
     // Load settings from extra items file
     new real_name[32]
     copy(real_name, charsmax(real_name), name)
     ArrayPushString(g_ItemRealName, real_name)
     
     // Name
     if (!amx_load_setting_string(ZP_EXTRAITEMS_FILE, real_name, "NAME", name, charsmax(name)))
     amx_save_setting_string(ZP_EXTRAITEMS_FILE, real_name, "NAME", name)
     ArrayPushString(g_ItemName, name)
     
     // Cost
     if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "COST", cost))
     amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "COST", cost)
     ArrayPushCell(g_ItemCost, cost)
     
     g_ItemCount++
     return g_ItemCount - 1;
    }

    public native_items_get_id(plugin_id, num_params)
    {
     new real_name[32]
     get_string(1, real_name, charsmax(real_name))
     
     // Loop through every item
     new index, item_name[32]
     for (index = 0; index < g_ItemCount; index++)
     {
     ArrayGetString(g_ItemRealName, index, item_name, charsmax(item_name))
     if (equali(real_name, item_name))
     return index;
     }
     
     return ZP_INVALID_ITEM;
    }

    public native_items_get_name(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new name[32]
     ArrayGetString(g_ItemName, item_id, name, charsmax(name))
     
     new len = get_param(3)
     set_string(2, name, len)
     return true;
    }

    public native_items_get_real_name(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new real_name[32]
     ArrayGetString(g_ItemRealName, item_id, real_name, charsmax(real_name))
     
     new len = get_param(3)
     set_string(2, real_name, len)
     return true;
    }

    public native_items_get_cost(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return -1;
     }
     
     return ArrayGetCell(g_ItemCost, item_id);
    }

    public native_items_show_menu(plugin_id, num_params)
    {
     new id = get_param(1)
     
     if (!is_user_connected(id))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
     return false;
     }
     
     clcmd_items(id)
     return true;
    }

    public native_items_force_buy(plugin_id, num_params)
    {
     new id = get_param(1)
     
     if (!is_user_connected(id))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
     return false;
     }
     
     new item_id = get_param(2)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new ignorecost = get_param(3)
     
     buy_item(id, item_id, ignorecost)
     return true;
    }

    public native_items_menu_text_add(plugin_id, num_params)
    {
     static text[32]
     get_string(1, text, charsmax(text))
     format(g_AdditionalMenuText, charsmax(g_AdditionalMenuText), "%s%s", g_AdditionalMenuText, text)
    }

    public client_disconnect(id)
    {
     // Reset remembered menu pages
     MENU_PAGE_ITEMS = 0
    }

    public clcmd_items(id)
    {
     // Player dead
     if (!is_user_alive(id))
     return;
     
     show_items_menu(id)
    }

    // Items Menu
    show_items_menu(id)
    {
     if (zp_gamemodes_get_current() == ZP_NO_GAME_MODE)
     {
     zp_colored_print(id, "^1ESPERE O ROUND INICIAR...")
     return;
     }
     else
     {

     static menu[128], name[32], cost, transkey[64]
     new menuid, index, itemdata[2]
     
     // Title
     formatex(menu, charsmax(menu), "%L:\r", id, "MENU_EXTRABUY")
     menuid = menu_create(menu, "menu_extraitems")
     
     // Item List
     for (index = 0; index < g_ItemCount; index++)
     {
     // Additional text to display
     g_AdditionalMenuText[0] = 0
     
     // Execute item select attempt forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_PRE], g_ForwardResult, id, index, 0)
     
     // Show item to player?
     if (g_ForwardResult >= ZP_ITEM_DONT_SHOW)
     continue;
     
     // Add Item Name and Cost
     ArrayGetString(g_ItemName, index, name, charsmax(name))
     cost = ArrayGetCell(g_ItemCost, index)
     
     // ML support for item name
     formatex(transkey, charsmax(transkey), "ITEMNAME %s", name)
     if (GetLangTransKey(transkey) != TransKey_Bad) formatex(name, charsmax(name), "%L", id, transkey)
     
     // Item available to player?
     if (g_ForwardResult >= ZP_ITEM_NOT_AVAILABLE)
     formatex(menu, charsmax(menu), "\d%s %d %s", name, cost, g_AdditionalMenuText)
     else
     formatex(menu, charsmax(menu), "%s \y%d \w%s", name, cost, g_AdditionalMenuText)
     
     itemdata[0] = index
     itemdata[1] = 0
     menu_additem(menuid, menu, itemdata)
     }
     
     // No items to display?
     if (menu_items(menuid) <= 0)
     {
     zp_colored_print(id, "%L", id, "NO_EXTRA_ITEMS")
     menu_destroy(menuid)
     return;
     }
     
     // Back - Next - Exit
     formatex(menu, charsmax(menu), "%L", id, "MENU_BACK")
     menu_setprop(menuid, MPROP_BACKNAME, menu)
     formatex(menu, charsmax(menu), "%L", id, "MENU_NEXT")
     menu_setprop(menuid, MPROP_NEXTNAME, menu)
     formatex(menu, charsmax(menu), "%L", id, "MENU_EXIT")
     menu_setprop(menuid, MPROP_EXITNAME, menu)
     
     // If remembered page is greater than number of pages, clamp down the value
     MENU_PAGE_ITEMS = min(MENU_PAGE_ITEMS, menu_pages(menuid)-1)
     
     // Fix for AMXX custom menus
     set_pdata_int(id, OFFSET_CSMENUCODE, 0)
     menu_display(id, menuid, MENU_PAGE_ITEMS)
     }
    }

    // Items Menu
    public menu_extraitems(id, menuid, item)
    {
     // Menu was closed
     if (item == MENU_EXIT)
     {
     MENU_PAGE_ITEMS = 0
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
     }
     
     // Remember items menu page
     MENU_PAGE_ITEMS = item / 7
     
     // Dead players are not allowed to buy items
     if (!is_user_alive(id))
     {
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
     }
     
     // Retrieve item id
     new itemdata[2], dummy, itemid
     menu_item_getinfo(menuid, item, dummy, itemdata, charsmax(itemdata), _, _, dummy)
     itemid = itemdata[0]
     
     // Attempt to buy the item
     buy_item(id, itemid)
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
    }

    // Buy Item
    buy_item(id, itemid, ignorecost = 0)
    {
     // Execute item select attempt forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_PRE], g_ForwardResult, id, itemid, ignorecost)
     
     // Item available to player?
     if (g_ForwardResult >= ZP_ITEM_NOT_AVAILABLE)
     return;
     
     // Execute item selected forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_POST], g_ForwardResult, id, itemid, ignorecost)
    }
    cancels
    cancels
    Humano


    Nick : ByVodka
    Masculino Número de Mensagens : 66
    Woow!!
    Ammo Packs : 2691
    Honra : 1
    Data de inscrição : 25/06/2017

    [PEDIDO] Bloqueando M2 no ZP 5.0 Empty Re: [PEDIDO] Bloqueando M2 no ZP 5.0

    Mensagem por cancels 12/6/2018, 10:06 pm

    abre a lang zombie_plague.txt e adicione uma nova linha com esse nome

    CANT_BUYITEM_NOW = 

    coloque a msg que querer ex:

    CANT_BUYITEM_NOW = Não pode abrir os Menu antes do Round começar!

    como o seu e so pra steam acho que pode usar os acento

    Código:
    #include <amxmodx>
    #include <fakemeta>
    #include <amx_settings_api>
    #include <zp50_colorchat>
    #include <zp50_items_const>
    #include <zp50_gamemodes>

    // Extra Items file
    new const ZP_EXTRAITEMS_FILE[] = "zp_extraitems.ini"

    // CS Player PData Offsets (win32)
    const OFFSET_CSMENUCODE = 205

    #define MAXPLAYERS 32

    // For item list menu handlers
    #define MENU_PAGE_ITEMS g_menu_data[id]
    new g_menu_data[MAXPLAYERS+1]

    enum _:TOTAL_FORWARDS
    {
     FW_ITEM_SELECT_PRE = 0,
     FW_ITEM_SELECT_POST
    }
    new g_Forwards[TOTAL_FORWARDS]
    new g_ForwardResult

    // Items data
    new Array:g_ItemRealName
    new Array:g_ItemName
    new Array:g_ItemCost
    new g_ItemCount
    new g_AdditionalMenuText[32]

    new g_iRoundStarted;

    public plugin_init()
    {
     register_plugin("[ZP] Items Manager", ZP_VERSION_STRING, "ZP Dev Team")
     
     register_clcmd("say /items", "clcmd_items")
     register_clcmd("say items", "clcmd_items")
     
     g_Forwards[FW_ITEM_SELECT_PRE] = CreateMultiForward("zp_fw_items_select_pre", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL)
     g_Forwards[FW_ITEM_SELECT_POST] = CreateMultiForward("zp_fw_items_select_post", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL)
    }

    public plugin_natives()
    {
     register_library("zp50_items")
     register_native("zp_items_register", "native_items_register")
     register_native("zp_items_get_id", "native_items_get_id")
     register_native("zp_items_get_name", "native_items_get_name")
     register_native("zp_items_get_real_name", "native_items_get_real_name")
     register_native("zp_items_get_cost", "native_items_get_cost")
     register_native("zp_items_show_menu", "native_items_show_menu")
     register_native("zp_items_force_buy", "native_items_force_buy")
     register_native("zp_items_menu_text_add", "native_items_menu_text_add")
     
     // Initialize dynamic arrays
     g_ItemRealName = ArrayCreate(32, 1)
     g_ItemName = ArrayCreate(32, 1)
     g_ItemCost = ArrayCreate(1, 1)
    }

    public zp_fw_gamemodes_end()
    {
     g_iRoundStarted = 0;
    }

    public zp_fw_gamemodes_start()
    {
     g_iRoundStarted = 1;
    }

    public native_items_register(plugin_id, num_params)
    {
     new name[32], cost = get_param(2)
     get_string(1, name, charsmax(name))
     
     if (strlen(name) < 1)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Can't register item with an empty name")
     return ZP_INVALID_ITEM;
     }
     
     new index, item_name[32]
     for (index = 0; index < g_ItemCount; index++)
     {
     ArrayGetString(g_ItemRealName, index, item_name, charsmax(item_name))
     if (equali(name, item_name))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Item already registered (%s)", name)
     return ZP_INVALID_ITEM;
     }
     }
     
     // Load settings from extra items file
     new real_name[32]
     copy(real_name, charsmax(real_name), name)
     ArrayPushString(g_ItemRealName, real_name)
     
     // Name
     if (!amx_load_setting_string(ZP_EXTRAITEMS_FILE, real_name, "NAME", name, charsmax(name)))
     amx_save_setting_string(ZP_EXTRAITEMS_FILE, real_name, "NAME", name)
     ArrayPushString(g_ItemName, name)
     
     // Cost
     if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "COST", cost))
     amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "COST", cost)
     ArrayPushCell(g_ItemCost, cost)
     
     g_ItemCount++
     return g_ItemCount - 1;
    }

    public native_items_get_id(plugin_id, num_params)
    {
     new real_name[32]
     get_string(1, real_name, charsmax(real_name))
     
     // Loop through every item
     new index, item_name[32]
     for (index = 0; index < g_ItemCount; index++)
     {
     ArrayGetString(g_ItemRealName, index, item_name, charsmax(item_name))
     if (equali(real_name, item_name))
     return index;
     }
     
     return ZP_INVALID_ITEM;
    }

    public native_items_get_name(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new name[32]
     ArrayGetString(g_ItemName, item_id, name, charsmax(name))
     
     new len = get_param(3)
     set_string(2, name, len)
     return true;
    }

    public native_items_get_real_name(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new real_name[32]
     ArrayGetString(g_ItemRealName, item_id, real_name, charsmax(real_name))
     
     new len = get_param(3)
     set_string(2, real_name, len)
     return true;
    }

    public native_items_get_cost(plugin_id, num_params)
    {
     new item_id = get_param(1)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return -1;
     }
     
     return ArrayGetCell(g_ItemCost, item_id);
    }

    public native_items_show_menu(plugin_id, num_params)
    {
     new id = get_param(1)
     
     if (!is_user_connected(id))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
     return false;
     }
     
     clcmd_items(id)
     return true;
    }

    public native_items_force_buy(plugin_id, num_params)
    {
     new id = get_param(1)
     
     if (!is_user_connected(id))
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
     return false;
     }
     
     new item_id = get_param(2)
     
     if (item_id < 0 || item_id >= g_ItemCount)
     {
     log_error(AMX_ERR_NATIVE, "[ZP] Invalid item id (%d)", item_id)
     return false;
     }
     
     new ignorecost = get_param(3)
     
     buy_item(id, item_id, ignorecost)
     return true;
    }

    public native_items_menu_text_add(plugin_id, num_params)
    {
     static text[32]
     get_string(1, text, charsmax(text))
     format(g_AdditionalMenuText, charsmax(g_AdditionalMenuText), "%s%s", g_AdditionalMenuText, text)
    }

    public client_disconnect(id)
    {
     // Reset remembered menu pages
     MENU_PAGE_ITEMS = 0
    }

    public clcmd_items(id)
    {
     // Player dead
     if (!is_user_alive(id))
     return;

     if (!g_iRoundStarted)
     {
     zp_colored_print(id, "%L", id, "CANT_BUYITEM_NOW");
     return;
     }
     
     show_items_menu(id)
    }

    // Items Menu
    show_items_menu(id)
    {
     static menu[128], name[32], cost, transkey[64]
     new menuid, index, itemdata[2]
     
     // Title
     formatex(menu, charsmax(menu), "%L:\r", id, "MENU_EXTRABUY")
     menuid = menu_create(menu, "menu_extraitems")
     
     // Item List
     for (index = 0; index < g_ItemCount; index++)
     {
     // Additional text to display
     g_AdditionalMenuText[0] = 0
     
     // Execute item select attempt forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_PRE], g_ForwardResult, id, index, 0)
     
     // Show item to player?
     if (g_ForwardResult >= ZP_ITEM_DONT_SHOW)
     continue;
     
     // Add Item Name and Cost
     ArrayGetString(g_ItemName, index, name, charsmax(name))
     cost = ArrayGetCell(g_ItemCost, index)
     
     // ML support for item name
     formatex(transkey, charsmax(transkey), "ITEMNAME %s", name)
     if (GetLangTransKey(transkey) != TransKey_Bad) formatex(name, charsmax(name), "%L", id, transkey)
     
     // Item available to player?
     if (g_ForwardResult >= ZP_ITEM_NOT_AVAILABLE)
     formatex(menu, charsmax(menu), "\d%s %d %s", name, cost, g_AdditionalMenuText)
     else
     formatex(menu, charsmax(menu), "%s \y%d \w%s", name, cost, g_AdditionalMenuText)
     
     itemdata[0] = index
     itemdata[1] = 0
     menu_additem(menuid, menu, itemdata)
     }
     
     // No items to display?
     if (menu_items(menuid) <= 0)
     {
     zp_colored_print(id, "%L", id, "NO_EXTRA_ITEMS")
     menu_destroy(menuid)
     return;
     }
     
     // Back - Next - Exit
     formatex(menu, charsmax(menu), "%L", id, "MENU_BACK")
     menu_setprop(menuid, MPROP_BACKNAME, menu)
     formatex(menu, charsmax(menu), "%L", id, "MENU_NEXT")
     menu_setprop(menuid, MPROP_NEXTNAME, menu)
     formatex(menu, charsmax(menu), "%L", id, "MENU_EXIT")
     menu_setprop(menuid, MPROP_EXITNAME, menu)
     
     // If remembered page is greater than number of pages, clamp down the value
     MENU_PAGE_ITEMS = min(MENU_PAGE_ITEMS, menu_pages(menuid)-1)
     
     // Fix for AMXX custom menus
     set_pdata_int(id, OFFSET_CSMENUCODE, 0)
     menu_display(id, menuid, MENU_PAGE_ITEMS)
    }

    // Items Menu
    public menu_extraitems(id, menuid, item)
    {
     // Menu was closed
     if (item == MENU_EXIT)
     {
     MENU_PAGE_ITEMS = 0
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
     }
     
     // Remember items menu page
     MENU_PAGE_ITEMS = item / 7
     
     // Dead players are not allowed to buy items
     if (!is_user_alive(id))
     {
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
     }
     
     // Retrieve item id
     new itemdata[2], dummy, itemid
     menu_item_getinfo(menuid, item, dummy, itemdata, charsmax(itemdata), _, _, dummy)
     itemid = itemdata[0]
     
     // Attempt to buy the item
     buy_item(id, itemid)
     menu_destroy(menuid)
     return PLUGIN_HANDLED;
    }

    // Buy Item
    buy_item(id, itemid, ignorecost = 0)
    {
     // Execute item select attempt forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_PRE], g_ForwardResult, id, itemid, ignorecost)
     
     // Item available to player?
     if (g_ForwardResult >= ZP_ITEM_NOT_AVAILABLE)
     return;
     
     // Execute item selected forward
     ExecuteForward(g_Forwards[FW_ITEM_SELECT_POST], g_ForwardResult, id, itemid, ignorecost)
    }

    Conteúdo patrocinado


    [PEDIDO] Bloqueando M2 no ZP 5.0 Empty Re: [PEDIDO] Bloqueando M2 no ZP 5.0

    Mensagem por Conteúdo patrocinado


      Data/hora atual: 23/11/2024, 2:00 am