menu item
#1
como puedo agregar mas item ? me ayudan dejare otro sma de armas si pueden ayudar a ponerselo aqui en menu porfa

Código PHP:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <xs>
#include <hamsandwich>
#include <dhudmessage>
#include <biohazard>

#define PLUGIN_NAME    "[Biohazard] Shop"
#define PLUGIN_AUTHORS    "YONTU"
#define PLUGIN_VERSION    "1.0"

#define is_user_player(%1)     (1 <= %1 <= max_players)
#define DMG_HEGRENADE         (1<<24)
#define ENG_NULLENT        -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define GAK_WEAPONKEY        6871
#define TASK_DELAY        91249

new g_HostName[64], g_Ak47Gold[33], g_Ak47GoldenZoom[33], g_HealthRegen[33], Float:g_RegenDelay[33];
new 
g_user_xp[33], g_item[4][33], g_msg_ItemPickUp;
new 
g_PowerGlobalDelay 0g_PowerDelay[33];
new 
SpriteTextureLightningPowerSpriteShockWave;
new 
menutext_menu[128], text_items[5][128], menu_callbackmoney;
new 
data[6], name[64], accessCallBack;
new 
max_playerscvar_hostname;
new 
bool:ignorecost false;

enum
{
    
COST_GOLDEN_AK47 0,
    
COST_REGENERATOR_HUMAN,
    
COST_FROSTNADE,
    
COST_INFECTME
}

enum
{
    
COST_NOFLASH 0,
    
COST_SPEED,
    
COST_HEALTH,
    
COST_GRAVITY,
    
COST_STRIPW
}

// Costul itemelor din shop-ul oamenilor
new const SHOP_HUMANS[] = 
{
    
16000,        // COSTUL AK-47 DE AUR
    
3000,        // COSTUL REGENERATORULUI DE VIATA (VIATA MAXIMA = 200)
    
4000,        // COSTUL GRENADEI FROST
    
15000        // COSTUL AUTO-INFECTIEI
}

// Costul itemelor din shop-ul zombilor
new const SHOP_ZOMBIES[] = 
{
    
2,    // NO FLASH
    
2,     // SPEED BOOST
    
2,     // EXTRA HEALTH
    
2,     // LOW GRAVITY
    
2    // STRIP HUMANS WEAPONS
}

// Poti adauga mai multe ore respectand matricea de mai jos. Intre orele respective, costul itemelor va fi ignorat, adica itemele vor fi gratuite.
// NOTA: Dupa ultima linie a matriciei nu se pune virgula (vezi mai jos)
new ignore_cost_hours[][] = 
{
    {
0022},    // intre ora 00:00 si 07:00
    
{1617}    // intre ora 16:00 si 17:00
}

new const 
GoldenAK[][] = 
{
    
"models/biohazard/v_ak47_golden.mdl",
    
"models/biohazard/p_ak47_golden.mdl",
    
"models/biohazard/w_ak47_golden.mdl"
}

new const 
TAG[] = "[Biohazard]";
new const 
TargetAimingSound[][] = { "biohazard/target.wav""biohazard/target2.wav" };
new const 
PowerSound[] = "biohazard/wizard_skill.wav";
new const 
SpritePower[] = "sprites/biohazard/wizard.spr";

const 
PRIMARY_WEAPONS_BIT_SUM = (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)
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

public 
plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHORS);
    
is_biomod_active() ? plugin_init2() : pause("ad")
}

public 
plugin_init2()
{
    new 
omsi;
    
time(oms);
    for(
0sizeof ignore_cost_hoursi++)
    {
        if(
>=  ignore_cost_hours[i][0] && ignore_cost_hours[i][1])
        {
            
ignorecost true;
        }
    }

    
register_event("HLTV""event_NewRound""a""1=0""2=0");
    
register_event("CurWeapon""event_CurWeapon""be""1=1");
    
register_event("Damage""event_Damage""be");
    
register_event("DeathMsg""event_DeathMsg""a");

    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamagePre");
    
RegisterHam(Ham_Item_AddToPlayer"weapon_ak47""fw_AddToPlayer");
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack"1);
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack"1);

    
register_forward(FM_SetModel"fw_SetModel");
    
register_forward(FM_CmdStart"fw_CmdStart");
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink");

    
register_message(get_user_msgid("ScreenFade"), "msg_ScreenFade");
    
    
register_clcmd("say /shop""ShowShopMenu");
    
register_clcmd("say_team /shopS""ShowShopMenu");
    
register_clcmd("say shop""ShowShopMenu");
    
register_clcmd("say_team shop""ShowShopMenu");
    
register_clcmd("drop""cmd_use_power");
    
    
g_msg_ItemPickUp get_user_msgid("ItemPickup");
    
cvar_hostname get_cvar_pointer("hostname");
    
max_players get_maxplayers();
}

public 
plugin_precache()
{
    new 
i;
    for(
0sizeof GoldenAKi++)
        
precache_model(GoldenAK[i]);

    for(
0sizeof TargetAimingSoundi++)
        
precache_sound(TargetAimingSound[i]);
    
    
precache_sound(PowerSound);
    
precache_sound("weapons/zoom.wav");
    
    
Lightning precache_model("sprites/lgtning.spr");
    
ShockWave precache_model("sprites/shockwave.spr");
    
PowerSprite precache_model(SpritePower);
    
SpriteTexture precache_model("sprites/dot.spr");
}

public 
plugin_cfg()
{
    
get_pcvar_string(cvar_hostnameg_HostNamecharsmax(g_HostName));
}

public 
client_putinserver(id)
{
    
reset_vars(id);
}

public 
ShowShopMenu(id)
{
    if(!
is_user_alive(id))
    {
        
ColorChat(id"!4%s!1 Trebuie sa fii in viata pentru a deschide shop-ul."TAG);
        return 
PLUGIN_HANDLED;
    }
    else if(!
game_started())
    {
        
ColorChat(id"!4%s!1 Trebuie sa astepti pana incepe infectia pentru a deschide shop-ul."TAG);
        return 
PLUGIN_HANDLED;
    }

    if(!
is_user_zombie(id)) HumanShop(id);
    else 
ZombieShop(id);

    return 
PLUGIN_CONTINUE;
}

public 
HumanShop(id)
{
    !
ignorecost formatex(text_menucharsmax(text_menu), "\wHumans SHOP_HUMANS | Money:\r %d^n\y%s"cs_get_user_money(id), g_HostName) : formatex(text_menucharsmax(text_menu), "\wHumans SHOP_HUMANS | FREE ITEMS^n\y%s"g_HostName);
    
menu menu_create(text_menu"HumansHandler");
    
menu_callback menu_makecallback("CallBackMenuH");
    
    !
ignorecost formatex(text_items[0], charsmax(text_items[]), "Golden AK-47 -\r  %d $"SHOP_HUMANS[COST_GOLDEN_AK47]) : formatex(text_items[0], charsmax(text_items[]), "Golden AK-47");
    
menu_additem(menutext_items[0], "1"0menu_callback);

    !
ignorecost formatex(text_items[1], charsmax(text_items[]), "Health Regenerator (200 HP) -\r %d $"SHOP_HUMANS[COST_REGENERATOR_HUMAN]) : formatex(text_items[1], charsmax(text_items[]), "Health Regenerator (200 HP)");
    
menu_additem(menutext_items[1], "2"0menu_callback);

    !
ignorecost formatex(text_items[2], charsmax(text_items[]), "Frost Nade -\r %d $"SHOP_HUMANS[COST_FROSTNADE]) : formatex(text_items[2], charsmax(text_items[]), "Frost Nade");
    
menu_additem(menutext_items[2], "3"0menu_callback);

    
formatex(text_items[3], charsmax(text_items[]), "Infect me -\r %d $"SHOP_HUMANS[COST_INFECTME]);
    
menu_additem(menutext_items[3], "4"0menu_callback);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_CONTINUE;
}

public 
CallBackMenuH(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    
money cs_get_user_money(id);
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), namecharsmax(name), CallBack);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            if(
SHOP_HUMANS[COST_GOLDEN_AK47] > money && !ignorecost || g_Ak47Gold[id] == 1)
                return 
ITEM_DISABLED;
        }
        case 
2:
        {
            if(
SHOP_HUMANS[COST_REGENERATOR_HUMAN] > money && !ignorecost || g_HealthRegen[id] == 1)
                return 
ITEM_DISABLED;
        }
        case 
3:
        {
            if(
SHOP_HUMANS[COST_FROSTNADE] > money && !ignorecost || user_has_weapon(idCSW_SMOKEGRENADE))
                return 
ITEM_DISABLED;
        }
        case 
4:
        {
            if(
SHOP_HUMANS[COST_INFECTME] > money || !allow_infection())
                return 
ITEM_DISABLED;
        }
    }
    
    return 
ITEM_ENABLED;
}

public 
HumansHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    
money cs_get_user_money(id);
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), namecharsmax(name), CallBack);
    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            new 
szWeapons[32], iNum;
            
get_user_weapons(idszWeaponsiNum);

            for(new 
0iNumi++)
            {
                if(
PRIMARY_WEAPONS_BIT_SUM & (1<<szWeapons[i]))
                {
                    new 
weaponname[32];
                    
get_weaponname(szWeapons[i], weaponnamecharsmax(weaponname));
                    
bacon_strip_weapon(idweaponname);
                }
            }
            
g_Ak47Gold[id] = 1;
            
give_item(id"weapon_ak47");

            if(!
ignorecost)
            {
                new 
cost_ak47 SHOP_HUMANS[COST_GOLDEN_AK47];
                
cs_set_user_money(idmoney cost_ak47);
                
ColorChat(id"!4%s!1 You bought!3 Golden AK-47!1 with!3 %d!1 money."TAGcost_ak47);
            }
        }

        case 
2:
        {
            
g_HealthRegen[id] = 1;
            
ColorChat(id"!4%s!1 Your health will be regenerated with!3 1 HP!1/!3sec!1 (!3MAX 200 HP!1)."TAG);

            if(!
ignorecost)
            {
                new 
cost_regen SHOP_HUMANS[COST_REGENERATOR_HUMAN];
                
cs_set_user_money(idmoney cost_regen);
                
ColorChat(id"!4%s!1 You bought!3 health regenerator!1 with!3 %d!1 money."TAGcost_regen);
            }
        }

        case 
3:
        {
            if(!
ignorecost)
            {
                new 
cost_fn SHOP_HUMANS[COST_FROSTNADE];
                
cs_set_user_money(idmoney cost_fn);
                
ColorChat(id"!4%s!1 You bought a!3 frostnade!1 with!3 %d!1 money."TAGcost_fn);
            }

            
give_item(id"weapon_smokegrenade");
        }

        case 
4:
        {
            
infect_user(id0);
            
            new 
zm_name[32];
            
get_user_name(idzm_namecharsmax(zm_name));
            
ColorChat(0"!4%s!3 %s!1 become a zombie. He was infected by a strange plague."TAGzm_name);
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
ZombieShop(id)
{
    
formatex(text_menucharsmax(text_menu), "\wXP:\r %d^n\w* Infect more humans and gain experience points.^n*\r ONLY\w first zombie can receive XP.^n*\y 1 infection = 1 XP^n\w* Only item during one round."g_user_xp[id]);
    
menu menu_create(text_menu"ZombiesHandler");
    
menu_callback menu_makecallback("CallBackMenuZ");
    
    
formatex(text_items[0], charsmax(text_items[]), "NO FLASH -\d Immune to flashbangs\w [\y%d XP\w]"SHOP_ZOMBIES[COST_NOFLASH]);
    
menu_additem(menutext_items[0], "1"0menu_callback);

    
formatex(text_items[1], charsmax(text_items[]), "SPEED BOOST -\d Increase your speed by 20%%\w [\y%d XP\w]"SHOP_ZOMBIES[COST_SPEED]);
    
menu_additem(menutext_items[1], "2"0menu_callback);

    
formatex(text_items[2], charsmax(text_items[]), "EXTRA HEALTH -\d  Increase your health by 30%%\w [\y%d XP\w]"SHOP_ZOMBIES[COST_HEALTH]);
    
menu_additem(menutext_items[2], "3"0menu_callback);

    
formatex(text_items[3], charsmax(text_items[]), "LOW GRAVITY -\d Increase your gravity with 50%%\w [\y%d XP\w]"SHOP_ZOMBIES[COST_GRAVITY]);
    
menu_additem(menutext_items[3], "4"0menu_callback);

    
formatex(text_items[4], charsmax(text_items[]), "STRIP HUMANS WEAPONS [\y%d XP\w]"SHOP_ZOMBIES[COST_STRIPW]);
    
menu_additem(menutext_items[4], "5"0menu_callback);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_CONTINUE;
}

public 
CallBackMenuZ(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], name[64], accessCallBack;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), namecharsmax(name), CallBack);
    
    switch(
data[0])
    {
        case 
'1':
        {
            if(
g_user_xp[id] < || SHOP_ZOMBIES[COST_NOFLASH] > g_user_xp[id] || g_item[0][id] == 1)
                return 
ITEM_DISABLED;
        }
        case 
'2':
        {
            if(
g_user_xp[id] < || SHOP_ZOMBIES[COST_SPEED] > g_user_xp[id] || g_item[1][id] == 1)
                return 
ITEM_DISABLED;
        }
        case 
'3':
        {
            if(
g_user_xp[id] < || SHOP_ZOMBIES[COST_HEALTH] > g_user_xp[id] || get_user_health(id) >= 500)
                return 
ITEM_DISABLED;
        }
        case 
'4':
        {
            if(
g_user_xp[id] < || SHOP_ZOMBIES[COST_GRAVITY] > g_user_xp[id] || g_item[2][id] == 1)
                return 
ITEM_DISABLED;
        }
        case 
'5':
        {
            if(
g_user_xp[id] < || SHOP_ZOMBIES[COST_STRIPW] > g_user_xp[id] || g_item[3][id] == 1)
                return 
ITEM_DISABLED;
        }
    }
    
    return 
ITEM_ENABLED;
}

public 
ZombiesHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], name[64], accessCallBack;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), namecharsmax(name), CallBack);
    new 
iKey str_to_num(data);

    switch(
iKey)
    {
        case 
1:
        {
            new 
cost_nf SHOP_ZOMBIES[COST_NOFLASH];
            
g_item[0][id] = 1;
            
g_user_xp[id] -= cost_nf;
            
ColorChat(id"!4%s!1 You bought!3 no flash!1 with!3 %d!1 XP."TAGcost_nf);
        }
        case 
2:
        {
            new 
Float:speed 0.2 get_user_maxspeed(id);
            new 
cost_speed SHOP_ZOMBIES[COST_SPEED];
            
set_user_maxspeed(idget_user_maxspeed(id) + speed);
            
g_item[1][id] = 1;
            
g_user_xp[id] -= cost_speed;
            
ColorChat(id"!4%s!1 You bought!3 %0.1f!1 speed with!3 %d!1 XP."TAGspeedcost_speed);
        }
        case 
3:
        {
            new 
Float:health;
            
pev(idpev_healthhealth);

            new 
Float:hp 0.3 health;
            new 
cost_hp SHOP_ZOMBIES[COST_HEALTH];
            new 
Float:max_hp 500.0;

            
message_begin(MSG_ONEg_msg_ItemPickUp_id);
            
write_string("cross");
            
write_byte(255);
            
write_byte(0);
            
write_byte(0);
            
message_end();

            
emit_sound(idCHAN_VOICE"items/tr_kevlar.wav"VOL_NORMATTN_NORM0PITCH_NORM);

            
set_pev(idpev_healthfloatclamp(health hp0.0max_hp));

            
g_user_xp[id] -= cost_hp;
            
ColorChat(id"!4%s!1 You bought!3 %0.1f!1 health with!3 %d!1 XP."TAG, (get_user_health(id) >= max_hp) ? max_hp hpcost_hp);
        }
        case 
4:
        {
            new 
Float:gravity 0.5 get_user_gravity(id);
            new 
cost_gv SHOP_ZOMBIES[COST_GRAVITY];
            
set_user_gravity(idget_user_gravity(id) - gravity);
            
g_item[2][id] = 1;
            
g_user_xp[id] -= cost_gv;
            
ColorChat(id"!4%s!1 You bought gravity with!3 %d!1 XP. Your gravity:!3 %0.1f!1."TAGcost_gvget_user_gravity(id) * 800.0);
        }
        case 
5:
        {
            new 
cost_shw SHOP_ZOMBIES[COST_STRIPW];
            
g_item[3][id] = 1;
            
PowerGlobalDelay();
            
g_user_xp[id] -= cost_shw;
            
ColorChat(id"!4%s!1 Now, you can strip humans weapons. Find a human, aim it, and!3 PRESS G!1."TAG);
            
ColorChat(id"!4%s!1 Cooldown:!3 15 sec."TAG);
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
event_NewRound()
{
    new 
Players[32], Numidi;
    
get_players(PlayersNum);
    for(
0Numi++)
    {
        
id Players[i];
        if(!
is_user_connected(id))
            continue;

        
reset_vars(id);
    }

    if(
ignorecost)
    {
        
ColorChat(0"!1%s!4 TOATE ITEMELE DIN SHOP-UL OAMENILOR SUNT GRATIS."TAG);
    }
}

public 
event_infect(victiminfector)
{
    if(!
is_user_alive(victim) || !is_user_alive(infector))
        return 
PLUGIN_HANDLED;
    
    
reset_vars(victim);
    
    if(
victim == infector || !is_user_infected(infector))
        return 
PLUGIN_HANDLED;
        
    
g_user_xp[infector]++;
    return 
PLUGIN_CONTINUE;
}

public 
event_CurWeapon(id)
{
    if(!
is_user_alive(id) || g_Ak47Gold[id] == 0)
        return 
PLUGIN_HANDLED;

    if(
get_user_weapon(id) == CSW_AK47)
    {
        
set_pev(idpev_viewmodel2GoldenAK[0]);
        
set_pev(idpev_weaponmodel2GoldenAK[1]);

        
// unlimited clip
        
set_pdata_int(get_pdata_cbase(id373), 51304);
    }

    return 
PLUGIN_CONTINUE;
}

public 
event_Damage(victim)
{
    if(!
is_user_alive(victim) || g_HealthRegen[victim] == || is_user_zombie(victim))
        return 
PLUGIN_CONTINUE
    
    
static Float:gametime;
    
gametime get_gametime();
    
g_RegenDelay[victim] = gametime 1.0;

    return 
PLUGIN_CONTINUE;
}

public 
event_DeathMsg()
{
    new 
id read_data(2);
    if(
is_user_connected(id))
        
reset_vars(id);
}

public 
fw_TakeDamagePre(iVictimiInflictoriAttackerFloat:fDamageiDmgType)
{
    if(
iVictim == iAttacker || !is_user_player(iAttacker) || !is_user_alive(iAttacker) || g_Ak47Gold[iAttacker] == 0)
        return 
HAM_HANDLED;

    if(
is_user_player(iAttacker) && get_user_weapon(iAttacker) == CSW_AK47 && is_user_zombie(iVictim))
    {
        
// bug fix
        
if(iDmgType DMG_HEGRENADE)
            return 
HAM_IGNORED;
        
        new 
Float:Damage 2.0;
        
fDamage *= Damage;
        
        
SetHamParamFloat(4fDamage);
        return 
HAM_HANDLED;
    }

    return 
HAM_IGNORED;
}

public 
fw_TraceAttack(entattackerFloat:damageFloat:dir[3], ptriDamageType)
{
    if(
is_user_player(attacker) && g_Ak47Gold[attacker] == && is_user_alive(attacker) && get_user_weapon(attacker) == CSW_AK47)
    {
        new 
Float:flEnd[3];
        
get_tr2(ptrTR_vecEndPosflEnd);

        
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
        
write_byte(TE_BEAMENTPOINT);
        
write_short(attacker 0x1000);
        
engfunc(EngFunc_WriteCoordflEnd[0]);
        
engfunc(EngFunc_WriteCoordflEnd[1]);
        
engfunc(EngFunc_WriteCoordflEnd[2]);
        
write_short(SpriteTexture);
        
write_byte(0);  // framerate
        
write_byte(0);  // framerate
        
write_byte(1);  // life
        
write_byte(5);  // width
        
write_byte(0);   // noise
        
write_byte(255);  // r, g, b
        
write_byte(215);  // r, g, b
        
write_byte(0);  // r, g, b
        
write_byte(200);  // brightness
        
write_byte(10);  // speed
        
message_end();
    }
    return 
HAM_IGNORED;
}

public 
fw_AddToPlayer(entid)
{
    if(
is_valid_ent(ent) && is_user_connected(id) && entity_get_int(entEV_INT_WEAPONKEY) == GAK_WEAPONKEY)
    {
        
g_Ak47Gold[id] = 1;
        
entity_set_int(entEV_INT_WEAPONKEY0);

        return 
HAM_HANDLED;
    }

    return 
HAM_IGNORED;
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED;
        
    if(!
equal(model"models/w_ak47.mdl")) 
        return 
FMRES_IGNORED;
        
    static 
szClassName[33];
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName));
        
    if(!
equal(szClassName"weaponbox"))
        return 
FMRES_IGNORED
    
    
static iOwneriStoredAkID
    iOwner 
entity_get_edict(entityEV_ENT_owner);
    
iStoredAkID fm_find_ent_by_owner(ENG_NULLENT"weapon_ak47"entity);
    
    if(
g_Ak47Gold[iOwner] == && is_valid_ent(iStoredAkID))
    {
        
entity_set_int(iStoredAkIDEV_INT_WEAPONKEYGAK_WEAPONKEY);

        
g_Ak47Gold[iOwner] = 0;
        
entity_set_model(entityGoldenAK[2]);
        
        return 
FMRES_SUPERCEDE;
    }

    return 
FMRES_IGNORED;
}

public 
fw_CmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id)) 
        return 
PLUGIN_HANDLED
    
    
if((get_uc(uc_handleUC_Buttons) & IN_ATTACK2) && !(pev(idpev_oldbuttons) & IN_ATTACK2))
    {
        if(
get_user_weapon(id) == CSW_AK47 && g_Ak47Gold[id] == 1)
        {
            switch(
g_Ak47GoldenZoom[id])
            {
                case 
1:
                {
                    
g_Ak47GoldenZoom[id] = 0;
                    
cs_set_user_zoom(idCS_RESET_ZOOM0);
                }

                case 
0:
                {
                    
g_Ak47GoldenZoom[id] = 1
                    cs_set_user_zoom
(idCS_SET_AUGSG552_ZOOM0);
                    
emit_sound(idCHAN_ITEM"weapons/zoom.wav"0.202.400100);
                }
            }
        }

        return 
PLUGIN_CONTINUE;
    }

    return 
PLUGIN_HANDLED;
}

public 
fw_PlayerPreThink(id)
{
    if(!
is_user_alive(id) || g_HealthRegen[id] == || is_user_zombie(id))
        return 
FMRES_IGNORED;

    static 
Float:gametime
    gametime 
get_gametime();
    
    if(
get_user_health(id) < 200 && g_RegenDelay[id] < gametime)
    {
        
set_user_health(idget_user_health(id) + 1);
        
g_RegenDelay[id] = gametime 1;
    }
    
    return 
FMRES_IGNORED;
}

public 
msg_ScreenFade(msgiddestid)
{
    if(
g_item[0][id] == && is_user_zombie(id) && is_user_connected(id))
    {
        static 
data[4];
        
data[0] = get_msg_arg_int(4);
        
data[1] = get_msg_arg_int(5);
        
data[2] = get_msg_arg_int(6);
        
data[3] = get_msg_arg_int(7);
        
        if(
data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199)
            return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
cmd_use_power(id)
{        
    if(
is_user_alive(id) && is_user_zombie(id) && g_item[3][id] == 1)
    {
        
set_dhudmessage(202550, -1.00.780_1.0);

        if(
g_PowerGlobalDelay 0)
        {
            
show_dhudmessage(id"Strip ability not ready.^n(%d second%s remaining)"g_PowerGlobalDelayg_PowerGlobalDelay == "" "s");
        }
        else if(
g_PowerDelay[id] > 0)
        {
            
show_dhudmessage(id"Strip ability not ready.^n(%d second%s remaining)"g_PowerDelay[id], g_PowerDelay[id] == "" "s");
        }
        else
        {
            
g_PowerDelay[id] = 15;
            
PowerDelay(id);

            new 
targetbody;
            static 
Float:StartPos[3], Float:EndPos[3];
        
            
pev(idpev_originStartPos);
            
fm_get_aim_origin(idEndPos);
        
            
StartPos[2] += 16.0;
            
EndPos[2] += 16.0;
            
get_user_aiming(idtargetbody90000);
        
            if(
is_user_alive(target) && get_user_team(id) != get_user_team(target))
            {
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
                
write_byte(TE_EXPLOSION);
                
engfunc(EngFunc_WriteCoordEndPos[0]);
                
engfunc(EngFunc_WriteCoordEndPos[1]);
                
engfunc(EngFunc_WriteCoordEndPos[2]);
                
write_short(PowerSprite);
                
write_byte(10);
                
write_byte(30);
                
write_byte(4);
                
message_end();
            
                
emit_sound(idCHAN_WEAPONPowerSoundVOL_NORMATTN_NORM0PITCH_NORM);
                
emit_sound(targetCHAN_AUTOTargetAimingSound[random_num(0charsmax(TargetAimingSound))], VOL_NORMATTN_NORM0PITCH_NORM);
            
                
ShakeScreen(target3.0);
                
CreateTeBeamCylinder(target);
                
CreateThunder(target);
            
                new 
szWeapons[32], iNum;
                
get_user_weapons(targetszWeaponsiNum);

                for(new 
0iNumi++)
                {
                    if(
PRIMARY_WEAPONS_BIT_SUM|SECONDARY_WEAPONS_BIT_SUM & (1<<szWeapons[i]))
                    {
                        static 
szWeaponName[32];
                        
get_weaponname(szWeapons[i], szWeaponNamecharsmax(szWeaponName));
                        
bacon_strip_weapon(targetszWeaponName);
                    }
                }
                
                
ColorChat(target"!4%s!1 YOU LOST YOUR WEAPONS"TAG);

                if(!
is_user_connected(target))
                {
                    
ColorChat(id"!4%s!1 You didn't aim corectly."TAG);
                }
                else
                {
                    new 
name[32];
                    
get_user_name(targetnamecharsmax(name));
                    
ColorChat(id"!4%s!1 TARGET:!3 %s!1. He loses his weapons."TAGname);
                }
    
                
ShakeScreen(id2.0);
            }

            
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
            
write_byte(TE_BEAMENTS);
            
write_short(id);
            
write_short(target);
            
write_short(Lightning);
            
write_byte(0);
            
write_byte(15);
            
write_byte(20);
            
write_byte(80);
            
write_byte(10);
            
write_byte(47);
            
write_byte(217);
            
write_byte(90);
            
write_byte(255);
            
write_byte(0);
            
message_end();
        }
    }

    return 
PLUGIN_CONTINUE;
}

public 
CreateTeBeamCylinder(id)
{
    new 
fOrigin[3];
    
get_user_origin(idfOrigin0);
    
    
message_begin(MSG_ALLSVC_TEMPENTITY);
    
write_byte(21);
    
write_coord(fOrigin[0]);
    
write_coord(fOrigin[1]);
    
write_coord(fOrigin[2] + 10);
    
write_coord(fOrigin[0]);
    
write_coord(fOrigin[1]);
    
write_coord(fOrigin[2] + 80);
    
write_short(ShockWave);
    
write_byte(0);    
    
write_byte(0);
    
write_byte(4);
    
write_byte(60);
    
write_byte(0);
    
write_byte(100);
    
write_byte(200);
    
write_byte(50);
    
write_byte(255);
    
write_byte(0);
    
message_end();
}

public 
CreateThunder(id)
{
    new 
fOrigin[3], iStartPos[3];
    
get_user_origin(idfOrigin);
    
    
fOrigin[2] -= 26;
    
iStartPos[0] = fOrigin[0] + 150;
    
iStartPos[1] = fOrigin[1] + 150;
    
iStartPos[2] = fOrigin[2] + 800;
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(TE_BEAMPOINTS); 
    
write_coord(iStartPos[0]); 
    
write_coord(iStartPos[1]); 
    
write_coord(iStartPos[2]); 
    
write_coord(fOrigin[0]); 
    
write_coord(fOrigin[1]); 
    
write_coord(fOrigin[2]); 
    
write_short(Lightning);
    
write_byte(1);
    
write_byte(5);
    
write_byte(7);
    
write_byte(20);
    
write_byte(30);
    
write_byte(255);
    
write_byte(251);
    
write_byte(176);
    
write_byte(200);
    
write_byte(200);
    
message_end();
    
    
message_begin(MSG_PVSSVC_TEMPENTITYfOrigin);
    
write_byte(TE_SPARKS);
    
write_coord(fOrigin[0]);
    
write_coord(fOrigin[1]);
    
write_coord(fOrigin[2]);
    
message_end();
}

public 
ShakeScreen(id, const Float:iSeconds)
{
    static 
g_msg_SS 0;
    if(!
g_msg_SS)
        
g_msg_SS get_user_msgid("ScreenShake");
    
    
message_begin(MSG_ONEg_msg_SS_id);
    
write_short(floatround(4096.0 iSecondsfloatround_round));
    
write_short(floatround(4096.0 iSecondsfloatround_round));
    
write_short(1<<13);
    
message_end();
}

stock fm_get_aim_origin(idFloat:fOrigin[3])
{
    new 
Float:start[3], Float:view_ofs[3];
    
pev(idpev_originstart);
    
pev(idpev_view_ofsview_ofs);
    
xs_vec_add(startview_ofsstart);
    
    new 
Float:dest[3];
    
pev(idpev_v_angledest);
    
engfunc(EngFunc_MakeVectorsdest);
    
global_get(glb_v_forwarddest);
    
xs_vec_mul_scalar(dest9999.0dest);
    
xs_vec_add(startdestdest);
    
    
engfunc(EngFunc_TraceLinestartdest0id0);
    
get_tr2(0TR_vecEndPosfOrigin);
    
    return 
PLUGIN_HANDLED;
}

public 
reset_vars(id)
{
    if(
g_item[3][id] == 1) if(task_exists(TASK_DELAY id)) remove_task(TASK_DELAY id);
            
    new 
i;
    for(
04i++)
        
g_item[i][id] = 0;
        
    if(
g_Ak47Gold[id])
    {
        
g_Ak47Gold[id] = 0;
        
g_Ak47GoldenZoom[id] = 0;
        
cs_set_user_zoom(idCS_RESET_ZOOM0);
    }
    
    
g_HealthRegen[id] = 0;
    
g_RegenDelay[id] = 0.0;
}

public 
PowerGlobalDelay()
{
    new 
Players[32], Numid;
    
get_players(PlayersNum);
            
    for(new 
0Numi++)
    {
        
id Players[i];
        if(
is_user_zombie(id))
        {
            if(
g_PowerGlobalDelay 1)
            {
                
g_PowerGlobalDelay--;
                
set_task(1.0"PowerGlobalDelay")
            }
            else if(
g_PowerGlobalDelay <= 1)
            {
                
g_PowerGlobalDelay 0;
            
                if(
is_user_alive(id))
                {
                    
set_dhudmessage(202550, -1.00.780_2.0);
                    
show_dhudmessage(id"STRIP ABILITY is ready.^nNow, find a HUMAN and strip his weapons.");
                }
            }
        }
    }
}

public 
PowerDelay(id)
{
    if(
id >= TASK_DELAY)
        
id -= TASK_DELAY;
    
    if(
is_user_alive(id) && is_user_zombie(id))
    {
        if(
g_PowerDelay[id] > 1)
        {
            
g_PowerDelay[id]--;
            
set_task(1.0"PowerDelay"id+TASK_DELAY);
        }
        else if(
g_PowerDelay[id] <= 1)
        {
            
g_PowerDelay[id] = 0;
            
            
set_dhudmessage(202550, -1.00.780_2.0);
            
show_dhudmessage(id"STRIP ABILITY is ready.^nNow, find a HUMAN and strip his weapons.");
        }
    }
}

stock ColorChat(idString[], any:...)
{
    static 
szMesage[192];
    
vformat(szMesagecharsmax(szMesage), String3);
    
    
replace_all(szMesagecharsmax(szMesage), "!1""^1");
    
replace_all(szMesagecharsmax(szMesage), "!3""^3");
    
replace_all(szMesagecharsmax(szMesage), "!4""^4");
    
    static 
g_msg_SayText 0;
    if(!
g_msg_SayText)
        
g_msg_SayText get_user_msgid("SayText");
    
    new 
Players[32], iNum 1i;

     if(
idPlayers[0] = id;
    else 
get_players(PlayersiNum"ch");
    
    for(--
iNumiNum >= 0iNum--)
    {
        
Players[iNum];
    
        
message_begin(MSG_ONE_UNRELIABLEg_msg_SayText_i);
        
write_byte(i);
        
write_string(szMesage);
        
message_end();
    }
}

stock fm_find_ent_by_owner(id, const szClassName[], iOwnerjghgtype 0)
{
    new 
str_type[11] = "classname"iEnt id;

    switch(
jghgtype) {

        case 
1str_type "target";
        case 
2str_type "targetname";
    }

    while((
iEnt engfunc(EngFunc_FindEntityByStringiEntstr_typeszClassName)) && pev(iEntpev_owner) != iOwner) {  }
    return 
iEnt;
}

stock bacon_strip_weapon(indexweapon[])
{
    if(!
equal(weapon"weapon_"7)) 
        return 
PLUGIN_CONTINUE;

    static 
weaponid;
    
weaponid get_weaponid(weapon)
    
    if(!
weaponid
        return 
PLUGIN_CONTINUE;

    static 
weaponent;
    
weaponent fm_find_ent_by_owner(-1weaponindex);
    
    if(!
weaponent)
        return 
PLUGIN_CONTINUE;

    if(
get_user_weapon(index) == weaponid
        
ExecuteHamB(Ham_Weapon_RetireWeaponweaponent);

    if(!
ExecuteHamB(Ham_RemovePlayerItemindexweaponent)) 
        return 
PLUGIN_CONTINUE;
    
    
ExecuteHamB(Ham_Item_Killweaponent);
    
set_pev(indexpev_weaponspev(indexpev_weapons) & ~(1<<weaponid));

    return 
PLUGIN_HANDLED;
}

// from biohazard by cheap_suit
stock bool:allow_infection()
{
    static 
count[2];
    
count[0] = 0;
    
count[1] = 0;
    
    static 
index;
    for(
index 1index <= max_playersindex++)
    {
        if(
is_user_connected(index) && is_user_zombie(index)) 
            
count[0]++;
        else if(
is_user_alive(index)) 
            
count[1]++;
    }
    
    return (
count[0] < 31 && count[1] > 1) ? true false;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 


esta arma ponersela en menu

[php]
#include <zombie_escape>
#include <fakemeta_util>
#include <cstrike>
#include <fun>

#define CSW_WEAPON_BASE CSW_P90
#define CSW_NEW_WEAPON "weapon_lycanthrope"
#define CSW_OLD_WEAPON "weapon_p90"
#define WEAPON_KEY 9299292
#define OLD_WEAPON "models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))

new const Weapon_Models[][] = { "models/v_lycanthrope2.mdl", "models/p_lycanthrope.mdl", "models/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-1.wav", "weapons/sg552-2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }

new scope, bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock

public plugin_precache()
{
for(new g = 0; g < sizeof(Weapon_Models); g++)
precache_model(Weapon_Models[g])
for(new h = 0; h < sizeof(Weapon_Sounds); h++)
precache_sound(Weapon_Sounds[h])
for(new t = 0; t < sizeof(Weapon_Sprites); t++)
precache_generic(Weapon_Sprites[t])

g_Shock = precache_model("sprites/lycanthrope_hit.spr")

register_clcmd(CSW_NEW_WEAPON, "hook")
register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}

public hook(id)
{
engclient_cmd(id, CSW_OLD_WEAPON)
return PLUGIN_HANDLED
}

public plugin_init()
{
register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "JaCk GamePlay")
scope = ze_register_item("Lycanthrope", 40, 0)

// Events & Messages
register_message(get_user_msgid("DeathMsg"), "DeathMsg")
register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
register_event("HLTV", "New_Round", "a", "1=0", "2=0")

// Forwards
register_forward(FM_SetModel, "Fw_Set_Model", 1)
register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
register_forward(FM_CmdStart, "Fw_CmdStart")

// Hook Chains
RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
// Hams
RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)

// Cvars
Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}

public Fw_Item_Deploy_Post(weapon_ent)
{
new id = get_pdata_cbase(weapon_ent, 41, 4)
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
CurrentWeapon(id)
}

public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
if (use_type == 0 && is_user_valid(caller))
{
CurrentWeapon(caller)
}
}

public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
if(!is_user_valid(iAttacker))
return

static Float:flEnd[3]
get_tr2(ptr, TR_vecEndPos, flEnd)

if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
{
if(iEnt)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
write_short(iEnt)
message_end()
}
else
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_short(iAttacker)
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()

engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
write_byte(TE_SPRITE)
engfunc(EngFunc_WriteCoord,flEnd[0])
engfunc(EngFunc_WriteCoord,flEnd[1])
engfunc(EngFunc_WriteCoord,flEnd[2])
write_short(g_Shock)
write_byte(5)
write_byte(150)
message_end()
}
}

public Fw_Spawn(id)
{
if(!is_user_valid(id))
return

Remove_scope(id)
}

public New_Round()
{
for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
{
if(!is_user_valid(i) || !g_Hasscope[i])
continue

Remove_scope(i)
}
}

public Fw_Reload_Post(weapon_entity)
{
new id = pev(weapon_entity, pev_owner)
if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
return HAM_IGNORED

if(g_Hasscope[id])
{
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
set_pdata_float(weapon_entity, 48, 3.0, 4)
set_pdata_float(id, 83, 3.0, 5)
set_pdata_int(weapon_entity, 54, 1, 4)
UTIL_weapon_anim(id, weapon_entity, 1)
}
return HAM_IGNORED
}

public Fw_Reload(weapon_entity)
{
new id = pev(weapon_entity, pev_owner)
if (!is_user_valid(id) || ze_is_user_zombie(id))
return HAM_IGNORED

static iClipExtra
if(g_Hasscope[id])
{
iClipExtra = get_pcvar_num(Cvar_scope_Clip)
}

g_scope_TmpClip[id] = -1

new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
new iClip = get_pdata_int(weapon_entity, 51, 4)

if (iBpAmmo <= 0 || iClip >= iClipExtra)
return HAM_SUPERCEDE

g_scope_TmpClip[id] = iClip

return HAM_IGNORED
}

public Fw_AddToPlayer(ent, id)
{
if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
return HAM_IGNORED

if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
{
g_Hasscope[id] = true
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
entity_set_int(ent, EV_INT_impulse, 0)

message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
write_string(CSW_NEW_WEAPON)
write_byte(7)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(8)
write_byte(CSW_WEAPON_BASE)
write_byte(0)
message_end()
return HAM_HANDLED
}
else
{
message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
write_string(CSW_OLD_WEAPON)
write_byte(7)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(8)
write_byte(CSW_WEAPON_BASE)
write_byte(0)
message_end()
}
return HAM_IGNORED
}

public Fw_Precache_Event(type, const name[])
{
if(equal("events/p90.sc", name))
{
g_Eventscope = get_orig_retval()
}
}

public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
if(!is_user_valid(id))
return

if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
{
set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
}
}

public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
return

if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
{
engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}

public ze_user_humanized(id)
{
if(!is_user_valid(id))
return

Remove_scope(id)
}

public ze_user_infected(id, infector)
{
if(!is_user_valid(id) || !is_user_valid(infector))
return

Remove_scope(id)
}

public Fw_PrimaryAttack(Weapon)
{
g_IsInPrimaryAttack = 0

new szClip, szAmmo, id
id = get_pdata_cbase(Weapon, 41, 4)
get_user_weapon(id, szClip, szAmmo)
if(!is_user_valid(id) || ze_is_user_zombie(id))
return

g_IsInPrimaryAttack = 1
if(g_Hasscope[id])
{
if (!cs_get_weapon_ammo(Weapon))
return

new Float:push[3]
pev(id, pev_punchangle, push)
xs_vec_sub(push, cl_pushangle[id], push)
xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
xs_vec_add(push, cl_pushangle[id], push)
set_pev(id, pev_punchangle, push)
UTIL_weapon_anim(id, Weapon, random_num(3, 5))
emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}

public Fw_CmdStart(id, handle)
{
if(!is_user_valid(id) || ze_is_user_zombie(id))
return

if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
{
if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
{
g_hasZoom[id] = true
cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
}
else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
{
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
}
}
}

public Fw_Take_DMG(Victim, Inflictor, Attacker, FloatGran sonrisaamage, DamageType)
{
if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
return

if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
{
SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
}
}

public Fw_PrimaryAttack_Post(Weapon)
{
g_IsInPrimaryAttack = 0
new szClip, szAmmo, id
id = get_pdata_cbase(Weapon, 41, 4)
get_user_weapon(id, szClip, szAmmo)

if(!is_user_valid(id) || ze_is_user_zombie(id))
return

if(g_Hasscope[id])
{
if (!cs_get_weapon_ammo(Weapon))
return

new Float:push[3]
pev(id, pev_punchangle, push)
xs_vec_sub(push, cl_pushangle[id], push)
xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
xs_vec_add(push, cl_pushangle[id], push)
set_pev(id, pev_punchangle, push)
UTIL_weapon_anim(id, Weapon, random_num(3, 5))
emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}

public Fw_Set_Model(entity, model[])
{
if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
return FMRES_IGNORED

static szClassName[33], id
id = pev(entity, pev_owner)
pev(entity, pev_classname, szClassName, charsmax(szClassName))
if(!equal(szClassName, "weaponbox"))
return FMRES_IGNORED

if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
{
g_Hasscope[id] = false
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}

public CurrentWeapon(id)
{
if(!is_user_valid(id))
return

if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
{
if(g_hasZoom[id])
{
cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
}
else if(!g_hasZoom[id])
{
cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
}
cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])

message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
write_string(CSW_NEW_WEAPON)
write_byte(7)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(8)
write_byte(CSW_WEAPON_BASE)
write_byte(0)
message_end()

static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
if(Ent)
{
static FloatGran sonrisaelay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
if (Delay > 0.0)
{
set_pdata_float(Ent, 46, Delay, 4)
}
}
}
}

public DeathMsg(msg_id, msg_dest, id)
{
static szTruncatedWeapon[33], iAttacker, iVictim
get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))

iAttacker = get_msg_arg_int(1)
iVictim = get_msg_arg_int(2)

if(!is_user_valid(iAttacker) || iAttacker == iVictim) return

if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
{
set_msg_arg_string(4, "lycanthrope")
}
}

public ze_select_item_pre(id, itemid)
{
if(itemid != scope) return ZE_ITEM_AVAILABLE
if(ze_is_user_zombie(id)) return ZE_ITEM_DONT_SHOW
return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
if(itemid != scope)
return

Givescope(id)
}

public Givescope(id)
{
drop_weapons(id, 1)
new wep = give_item(id, CSW_OLD_WEAPON)
if (wep > 0)
{
cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))

message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
write_string(CSW_NEW_WEAPON)
write_byte(7)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(8)
write_byte(CSW_WEAPON_BASE)
write_byte(0)
message_end()
}
g_Hasscope[id] = true
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
ze_colored_print(id, "You bought Lycanthrope.")
}

public Remove_scope(id)
{
if(!is_user_valid(id))
return

g_Hasscope[id] = false
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
write_string(CSW_OLD_WEAPON)
write_byte(7)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(8)
write_byte(CSW_WEAPON_BASE)
write_byte(0)
message_end()
cs_reset_player_view_model(id, CSW_WEAPON_BASE)
cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}

UTIL_weapon_anim(index, entity, sequence = 0)
{
set_pev(index, pev_weaponanim, sequence)

message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
write_byte(sequence)
write_byte(pev(entity, pev_body))
message_end()
}

stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(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)

for (i = 0; i < num; i++)
{
weaponid = weapons[i]

if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang3073\\ f0\\ fs16 \n\\ par }
*/
[/php}
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)