vip gold menu от Leo_[BH]

DonCarlione

Заблокированные
Пользователь
Регистрация
6 Окт 2018
Сообщения
7
Симпатии
1
Пол
Мужской
Всем ку, помогите добавить модель W
помогите добавить модель W:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta_util>

#define is_valid_player(%1) (1 <= %1 <= 32)

// // // // // // // // // // MODEL

new GoldModels[8][64] = {
"models/gold_s/v_deagle.mdl", "models/gold_s/p_deagle.mdl",         // 0-1
"models/gold_s/v_awp.mdl", "models/gold_s/p_awp.mdl",                 // 2-3
"models/gold_black/v_ak47.mdl", "models/gold_black/p_ak47.mdl",     // 4-5
"models/gold_black/v_m4a1.mdl", "models/gold_black/p_m4a1.mdl" }     // 6-7

public plugin_precache()
{
    for (new num = 0; num < 8; num++)
    {
        precache_model(GoldModels[num]);
    }
}

// // // // // // // // // // // // // // // // // // // //

new round

new pistols[6] = {CSW_P228, CSW_ELITE, CSW_FIVESEVEN, CSW_DEAGLE, CSW_USP, CSW_GLOCK18}
new primary[18] = {CSW_SCOUT, CSW_XM1014, CSW_MAC10, CSW_AUG, CSW_UMP45, CSW_SG550, CSW_GALIL, CSW_FAMAS, CSW_AWP,
CSW_MP5NAVY, CSW_M249, CSW_M3, CSW_M4A1, CSW_TMP, CSW_G3SG1, CSW_SG552, CSW_AK47, CSW_P90}

new bool:has_gold_m4a1[33], bool:has_gold_ak47[33], bool:has_gold_awp[33], bool:has_gold_deagle[33]

// // // // // // // // // //

public plugin_init()
{
    register_plugin("Gold VIP Menu", "1.0", "Leo_[BH]")
    
    register_event("TextMsg", "event_game_restart", "a", "2=#Game_will_restart_in")
    register_event("TextMsg", "event_game_restart", "a", "2=#Game_Commencing")
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    
    register_event("WeapPickup","checkModel","b","1=19")
    register_event("CurWeapon","checkWeapon","be","1=1")
    register_event("DeathMsg", "Death", "a")
    
    register_clcmd("vipmenu", "cmd_vip_menu")
    register_clcmd("say vipmenu", "cmd_vip_menu")
    register_clcmd("say /vipmenu", "cmd_vip_menu")
    register_clcmd("say_team vipmenu", "cmd_vip_menu")
    register_clcmd("say_team /vipmenu", "cmd_vip_menu")
}

public event_round_start()
{
    round++
}

public event_game_restart()
{
    round = 0
}

// // // // // // // // // // MODEL

public checkModel(id)
{
    new WeaponID = read_data(2)
    
    switch(WeaponID)
    {
        case CSW_M4A1:
        {
            if(has_gold_m4a1[id])
            {
                set_pev(id, pev_viewmodel2, GoldModels[6])
                set_pev(id, pev_weaponmodel2, GoldModels[7])
            }
        }
        case CSW_AK47:
        {
            if(has_gold_ak47[id])
            {
                set_pev(id, pev_viewmodel2, GoldModels[4])
                set_pev(id, pev_weaponmodel2, GoldModels[5])
            }
        }
        case CSW_AWP:
        {
            if(has_gold_awp[id])
            {
                set_pev(id, pev_viewmodel2, GoldModels[2])
                set_pev(id, pev_weaponmodel2, GoldModels[3])
            }
        }
        case CSW_DEAGLE:
        {
            if(has_gold_deagle[id])
            {
                set_pev(id, pev_viewmodel2, GoldModels[0])
                set_pev(id, pev_weaponmodel2, GoldModels[1])
            }
        }
    }
    
    return PLUGIN_CONTINUE
}

public checkWeapon(id)
{
    checkModel(id)
}

public Death()
{
    new id = read_data(2)
    has_gold_m4a1[id] = false
    has_gold_ak47[id] = false
    has_gold_awp[id] = false
    has_gold_deagle[id] = false
}

public client_connect(id)
{
    has_gold_m4a1[id] = false
    has_gold_ak47[id] = false
    has_gold_awp[id] = false
    has_gold_deagle[id] = false
}

// // // // // // // // // // MENU

public cmd_vip_menu(id)
{
    if(get_user_flags(id) & ADMIN_LEVEL_H)
    {
        vip_weaponmenu(id)
    }
}

public vip_weaponmenu(id)
{
    if(round < 3)
    {
        client_print(id, print_chat, "С 3-ого раунда!")
        return PLUGIN_HANDLED;
    }
    
    new menu = menu_create("\yЗолотая \rОружейка", "handler_weaponmenu")
    
    menu_additem(menu, "\wM4A1",         "1")
    menu_additem(menu, "\wAK47",         "2")
    menu_additem(menu, "\wAWP",         "3")
    menu_additem(menu, "\wDEAGLE",         "4")

    menu_setprop(menu, MPROP_EXITNAME, "Выход")
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

    menu_display(id,menu,0)

    return PLUGIN_HANDLED;
}

public handler_weaponmenu(id, menu, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED
    }
    
    new data[6], iName[64], access, callback
    menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    {
        case 1: {
                remove_primary(id)
                give_item(id, "weapon_m4a1")
                cs_set_user_bpammo(id, CSW_M4A1, 120)
                has_gold_m4a1[id] = true
        }
        case 2: {
                remove_primary(id)
                give_item(id, "weapon_ak47")
                cs_set_user_bpammo(id, CSW_AK47, 120)
                has_gold_ak47[id] = true
        }
        case 3: {
                remove_primary(id)
                give_item(id, "weapon_awp")
                cs_set_user_bpammo(id, CSW_AWP, 45)
                has_gold_awp[id] = true
        }
        case 4: {
                give_item(id, "weapon_deagle")
                cs_set_user_bpammo(id, CSW_DEAGLE, 80)
                has_gold_deagle[id] = true
        }
    }
    return PLUGIN_HANDLED
}

// // // // // // // // // // remove primary

remove_primary(id)
{
    for(new i = 0; i < 18; i++)
    {
        fm_strip_user_gun(id, primary[i])
    }
}

public remove_secondary(id)
{
    for(new i = 0; i < 6; i++)
    {
        fm_strip_user_gun(id, pistols[i])
    }
}
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
963
Симпатии
685
Пол
Мужской
С разделом ошибся.
 
Сверху Снизу