Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSZombie Plague Human Class help


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hello, can someone help me with this plugin
I want when player choose human class he cannot open the menu anymore until new round starts
Code:

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <zp_apocalypse>

#define HM1_FLAG ADMIN_BAN
#define HM2_FLAG ADMIN_KICK
#define HM3_FLAG ADMIN_CHAT
#define HM4_FLAG ADMIN_SLAY
#define HM5_FLAG ADMIN_VOTE

const PRIMARY_WEAPONS_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)


new g_ent_weaponmodel[33];
new g_currentweapon[33];

new g_player_class[33]

public plugin_init()
{
        register_plugin("[ZP] Addon: Human Classes", "1.3", "fiendshard")
        register_clcmd("say /hm", "ClCmdSelectModel")
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
        if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
                return;
        static weapon
        weapon = get_msg_arg_int(2)
        g_currentweapon[msg_entity] = weapon
        fm_set_weaponmodel_ent(msg_entity)
}


public ClCmdSelectModel(id, menuid)
{
        if(zp_get_user_zombie(id) || zp_has_round_started() || zp_get_user_assassin(id) || zp_get_user_nemesis(id) || zp_get_user_sniper(id) || zp_get_user_survivor(id))
        {
                return PLUGIN_HANDLED;
        }
       
        else if(!is_user_alive(id))
        {
                return PLUGIN_HANDLED;
        }
        else
        {
                human_menu(id)
        }
        return PLUGIN_CONTINUE;
}

public human_menu(id)
{
        new menu = menu_create("\yChoose Human Class", "human_menu_handler")
        menu_additem(menu, "\wArmorer \y(+500 Armor)", "1", 0)
        menu_additem(menu, "\wPounder \y(+300 HP)", "2", 0)
        menu_additem(menu, "\wJumper \y(Low Gravity)", "3", 0)
        menu_additem(menu, "\wFrost Soldier \y(x5 Frost Nades)", "4", 0)
        menu_additem(menu, "\wFirebat \y(x5 Napalm Nades)", "5", 0)
        menu_setprop(menu,MPROP_EXITNAME,"Exit");
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, menu, 0)
       
}
public human_menu_handler(id, menu, item)
{
        if( item == MENU_EXIT )
        {
                menu_destroy(menu)
                return PLUGIN_HANDLED
        }
        new data[6], iName[64]
        new access, callback
        menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
        new key = str_to_num(data)
        switch(key)
        {
                case 1:
                {
                        if(!(get_user_flags(id) & HM1_FLAG)) {
                        client_print(id, print_chat, "You don't have access to this class!")
                        return PLUGIN_HANDLED;
                        }
                        if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id)) return PLUGIN_HANDLED;
                        g_player_class[id] = 1
                        set_user_armor(id, 500)
                        client_print(id, print_chat,"[ZP] Your selected Class is: Armorer (500 Armor)")
                }
                case 2:
                {
                        if(!(get_user_flags(id) & HM2_FLAG)) {
                        client_print(id, print_chat, "You don't have access to this class!")
                        return PLUGIN_HANDLED;
                        }
                        if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id)) return PLUGIN_HANDLED;
                        g_player_class[id] = 2
                        set_user_health(id, 300)
                        client_print(id, print_chat,"[ZP] Your selected Class is: Pounder (300 HP)");
                }
                case 3:
                {
                        if(!(get_user_flags(id) & HM3_FLAG)) {
                        client_print(id, print_chat, "You don't have access to this class!")
                        return PLUGIN_HANDLED;
                        }
                        if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id)) return PLUGIN_HANDLED;
                        g_player_class[id] = 3
                        set_user_gravity(id, 0.50)
                        client_print(id, print_chat,"[ZP] Your selected Class is: Jumper (Low Gravity)");
                }
                case 4:
                {
                        if(!(get_user_flags(id) & HM4_FLAG)) {
                        client_print(id, print_chat, "You don't have access to this class!")
                        return PLUGIN_HANDLED;
                        }
                        if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id)) return PLUGIN_HANDLED;
                        g_player_class[id] = 4
                        cs_set_user_bpammo(id, CSW_FLASHBANG, 5)
                        client_print(id, print_chat,"[ZP] Your selected Class is: Frost Soldier (x5 Frost Nades)");
                }
                case 5:
                {
                        if(!(get_user_flags(id) & HM5_FLAG)) {
                        client_print(id, print_chat, "You don't have access to this class!")
                        return PLUGIN_HANDLED;
                        }
                        if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id)) return PLUGIN_HANDLED;
                        g_player_class[id] = 5
                        cs_set_user_bpammo(id, CSW_HEGRENADE, 5)
                        client_print(id, print_chat,"[ZP] Your selected Class is: Firebat (x5 Napalm Nades)")
                }
        }
        menu_destroy(menu)
        return PLUGIN_HANDLED
}

public zp_user_infected_post(id, infector)
{
        fm_remove_model_ents(id)
}

stock fm_remove_model_ents(id)
{
        if (pev_valid(g_ent_weaponmodel[id]))
        {
                engfunc(EngFunc_RemoveEntity, g_ent_weaponmodel[id])
                g_ent_weaponmodel[id] = 0
        }
}

stock fm_set_weaponmodel_ent(id)
{
        static model[100]
        pev(id, pev_weaponmodel2, model, sizeof model - 1)
       
        if (!pev_valid(g_ent_weaponmodel[id]))
        {
                g_ent_weaponmodel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
                if (!pev_valid(g_ent_weaponmodel[id])) return;
               
                set_pev(g_ent_weaponmodel[id], pev_classname, "weapon_model")
                set_pev(g_ent_weaponmodel[id], pev_movetype, MOVETYPE_FOLLOW)
                set_pev(g_ent_weaponmodel[id], pev_aiment, id)
                set_pev(g_ent_weaponmodel[id], pev_owner, id)
        }
       
        engfunc(EngFunc_SetModel, g_ent_weaponmodel[id], model)
}

stock drop_primary_weapons(id)       
{
        static weapons [ 32 ], num, i, weaponid
        num = 0
        get_user_weapons (id, weapons, num )
       
        for ( i = 0; i < num; i++ )
        {
                weaponid = weapons [ i ]
                if  ( ( (1<<weaponid) & PRIMARY_WEAPONS_BITSUM ) )               
                {
                        static wname[32]
                        get_weaponname(weaponid, wname, charsmax(wname))
                        engclient_cmd(id, "drop", wname)
                }
        }
}

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...