como puedo poner este plugin de zp a modo normal¿¿¿
#1
Responder
#2
Sección equivocada, ahí lo moví a scripting. Por otro lado, pone el código entre etiquetas [PHP] o subilo como adjunto.
[Imagen: paypalqr.png]
Responder
#3
Código PHP:
<amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.4"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }

Responder
#4
(29/09/2016, 03:31 PM)SoundBlaster escribió:
Código PHP:
<amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.4"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }


no me sirvio no sale en el menu de comandos del amxmodWhatdone
Responder
#5
Fixeado..
Te recomiendo leer el codigo para que te des cuenta de donde estaba el error.
Código PHP:
#include <amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.4"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }

Idioma: [Extrangez]
Nivel de Amistad: [Depende de ti]

Aportes:
[Mapas]
zm_impressive

zm_laberim
zm_bunkeriM 28%

Made in Venezuela
Responder
#6
(29/09/2016, 04:18 PM)wester escribió: Fixeado..
Te recomiendo leer el codigo para que te des cuenta de donde estaba el error.
Código PHP:
#include <amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.4"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }


y el comando solo me salen los svars ayuda WhatdoneWhatdoneCutecryGenius
Responder
#7
(29/09/2016, 04:39 PM)mmeka12 escribió:
(29/09/2016, 04:18 PM)wester escribió: Fixeado..
Te recomiendo leer el codigo para que te des cuenta de donde estaba el error.
Código PHP:
#include <amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.4"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }


y el comando solo me salen los svars ayuda WhatdoneWhatdoneCutecryGenius

Código PHP:
#include <amxmodx>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <xs>

const UNIT_SECOND = (1<<12)


#define ENG_NULLENT    -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define POISON_WEAPONKEY    233
#define WEAP_LINUX_XTRA_OFF    4
#define m_fKnown    44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle    48
#define m_iClip    51
#define m_fInReload    54
#define PLAYER_LINUX_XTRA_OFF    5
#define m_flNextAttack    83
#define TIME_POISON    5.0
#define CSW_WPN_POISON    CSW_M3
#define OFFSET_TIME_ATTACK 0.6
#define WPN_RELOAD_TIME 3.4

new const gWeapon[] = "weapon_m3"

#define PLUGIN "[AMXX] Public: Poison Launcher"
#define VERSION "1.8.5"
#define AUTHOR "Re.Act!ve" 

new const g_item_name[] = { "Poison Launcher" }; // Item name
new const g_item_cost 20 // Item cost

#define RED 60
#define GREEN 250
#define BLUE 0
#define PEV_ENT_TIME pev_fuser1

// Precahce files
new const fire_model_name[] = "models/zm/spore.mdl"
new const fire_poison[] = "models/zm/spore_poison.mdl"
new const fire_spr_name[] = "sprites/laserbeam.spr"
new const fire_sprite[] = "sprites/zm/poison_spr.spr"
new const spr_poison_flare[] = "sprites/zm/poison_flare.spr"

new fire_sound[] = "weapons/plauncher-1.wav"
new g_sound[][] = {
    
"weapons/plauncher_draw.wav",
    
"weapons/plaunch_clipin.wav",
    
"weapons/plaunch_clipout.wav",
    
"weapons/plauncher_explode.wav"
}

new const 
v_model[] = "models/zm/v_plaunch_flipbyHiDanZ.mdl"
new const p_model[] = "models/zm/p_plaunch1.mdl"
new const w_model[] = "models/zm/w_plaunch.mdl"

// classname
new const fire_classname[] = "poison_fire"
new const poison_classname[] = "posion_spore"
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)
enum
{
    
IDLE_ANIM 0,
    
DRAW_ANIM 2,
    
RELOAD_ANIM 1,
    
SHOOT_ANIM 3,
    
SHOOT_ANIM1 4,
    
SHOOT_ANIM2 5
}

new 
sprite_abilityfire_spr_idfire_spr_nameidg_IsInPrimaryAttackcvar_start_damagecvar_end_damagecvar_clipcvar_maxclipcvar_shot_speedg_itemidcvar_movetype
new g_orig_eventFloat:g_poison_touch[33], oldweap[33], g_TmpClip[33], Float:gPoisonGlow[33], bool:gGlowPlayer[33], g_msgScreenShake
new bool:g_has_item[33], bool:disc_opened[33]

new const 
WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
    
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
    
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
    
"weapon_ak47""weapon_knife""weapon_p90" }

public 
plugin_precache()
{
    
precache_model(v_model)
    
precache_model(p_model)
    
precache_model(w_model)

    for(new 
i=0;i<sizeof g_sound;i++) precache_sound(g_sound[i])

    
precache_sound(fire_sound)

    
precache_model(fire_model_name)
    
precache_model(fire_poison)
    
sprite_ability engfunc(EngFunc_PrecacheModelspr_poison_flare)    
    
fire_spr_id precache_model(fire_sprite)
    
fire_spr_nameid precache_model(fire_spr_name)
}

public 
plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )

    
//g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)

    
cvar_shot_speed register_cvar("zp_pl_bulletspeed""500")    // Velocidad De Disparo
    
cvar_movetype register_cvar("zp_pl_movetype""0")    // 0 - Directa, 1 - Gravedad (Estilo De Disparo)
    
cvar_start_damage register_cvar("zp_pl_startdamage""250.0")    // Daño Minimo
    
cvar_end_damage register_cvar("zp_pl_enddamage""600.0")    // Daño Maximo
    
cvar_clip register_cvar("zp_pl_clip""15")    // Balas De Inicio
    
cvar_maxclip register_cvar("zp_pl_ammo""60")    // Municion Maxima
    
g_msgScreenShake get_user_msgid("ScreenShake")
    
set_cvar_num("sv_maxvelocity"8000)

    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackgWeapon"fw_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFramegWeapon"plasma_ItemPostFrame")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"fw_Reload")
    
RegisterHam(Ham_Weapon_ReloadgWeapon"Reload_Post"1)
    
RegisterHam(Ham_Item_AddToPlayergWeapon"fw_item_addtoplayer"1)

    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_PrecacheEvent"fwPrecacheEvent_Post"1)
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)

    
register_touch(fire_classname"*""fw_touch_shot")
    
register_think(fire_classname"fw_think")
    
register_touch(poison_classname"*""fw_touch_poison")

    
register_concmd"obtener_arma""setweapon" );

    for (new 
1sizeof WEAPONENTNAMESi++)
    if (
WEAPONENTNAMES[i][0]) 
    
RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
}

public 
setweaponid )
{
    if( !
is_user_aliveid ) ) return;

    
drop_weaponsid);
    
g_has_itemid ] = true;
    new 
iWep2 fm_give_itemidgWeapon );

    if( 
iWep2 )
    {
        
cs_set_weapon_ammoiWep2get_pcvar_numcvar_clip ) );
        
cs_set_user_bpammoidCSW_WPN_POISONget_pcvar_numcvar_maxclip ) );
    }

    
UTIL_PlayWeaponAnimationidDRAW_ANIM );
    
emit_soundidCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM );
}

public 
fwPrecacheEvent_Post(type, const name[])
{
    if (
equal("events/m3.sc"name))
    {
        
g_orig_event get_orig_retval()
        return 
FMRES_HANDLED
    
}
    return 
FMRES_IGNORED
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
        
    if(
get_user_weapon(id) != CSW_WPN_POISON || !g_has_item[id])
    return 
FMRES_IGNORED

    set_cd
(cd_handleCD_flNextAttackhalflife_time() + 0.001

    return 
FMRES_HANDLED
}

public 
fw_item_addtoplayer(entid)
{
    if(!
is_valid_ent(ent))
    return 
HAM_IGNORED

    
if(entity_get_int(entEV_INT_WEAPONKEY) == POISON_WEAPONKEY)
    {
        
g_has_item[id] = true;
        
entity_set_int(idEV_INT_impulse0)

        
replace_weapon_models(ident)
        return 
HAM_HANDLED
    
}

    return 
HAM_HANDLED
}

public 
client_connect(id)
g_has_item[id] = false

public client_disconnect(id)
g_has_item[id] = false

/*
public zp_user_infected_post(id)
{
    if (zp_get_user_zombie(id))
    g_has_item[id] = false
}
*/
public zp_user_humanized_post(id)
g_has_item[id] = false

public zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid
    {
        
drop_weapons(id,1)
        
g_has_item[id] = true;
        new 
iWep2 fm_give_item(id,gWeapon)
        if( 
iWep2 )
        {
            
cs_set_weapon_ammo(iWep2get_pcvar_num(cvar_clip))
            
cs_set_user_bpammo (idCSW_WPN_POISONget_pcvar_num(cvar_maxclip))    
        }
        
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
        
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
    }
}

public 
fw_PrimaryAttack(Weapon)
{
    if (
g_has_item[pevWeaponpev_owner )]) 
    {
        
g_IsInPrimaryAttack 1
        
return HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
fwPlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ((
eventid != g_orig_event) || !g_IsInPrimaryAttack)
    return 
FMRES_IGNORED

    
if (!(<= invoker <= get_maxplayers()))
    return 
FMRES_IGNORED

    playback_event
(flags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon414)

    new 
szClipszAmmo
    get_user_weapon
(PlayerszClipszAmmo)

    if(!
is_user_alive(Player))
    return

    if(
szClip == 0)
    return

    if(!
is_user_alive(Player))
    return

    if(
g_has_item[Player] || szClip >= 1)
    {
        
//set_pdata_float(Player , m_flNextAttack, OFFSET_TIME_ATTACK, PLAYER_LINUX_XTRA_OFF)
        
set_pdata_floatPlayer83OFFSET_TIME_ATTACK )
        
make_shoot(PlayerWeapon)
    }
}

public 
make_shoot(idWeapon)
{
    if(!
is_user_alive(id))
    return 
HAM_IGNORED;

    if(
get_user_weapon(id) != CSW_WPN_POISON)
    return 
HAM_IGNORED;

    if(!
g_has_item[id] || disc_opened[id])
    return 
HAM_IGNORED;

    new 
szClip
    get_user_weapon
(idszClip)

    if(
szClip >= 1)
    {
        new 
Float:Puch[3]
        
pev(idpev_punchanglePuch)
        
Puch[0]-=random_float(3.06.0)
        
cs_set_weapon_ammo(WeaponszClip-1)
        
emit_sound(idCHAN_WEAPONfire_sound1.0ATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(idrandom_num(SHOOT_ANIMSHOOT_ANIM2))
        
throw_fire(id)
        
set_pev(id,pev_punchangle,Puch)
    }
    return 
HAM_IGNORED;
}

public 
throw_fire(id)
{
    new 
iEnt create_entity("info_target")
    new 
Float:vfVelocity[3]

    
velocity_by_aim(id, (get_pcvar_num(cvar_shot_speed)*10), vfVelocity)

    
// add velocity of Owner for ent
    
new Float:vfAttack[3], Float:vfAngle[3], Float:vOfps[3]
    
get_weapon_attackment(idvfAttack20.0)
    
pev(idpev_view_ofsvOfps)
    
pev(idpev_anglesvfAngle)

    
// set info for ent
    
set_pev(iEntpev_movetypeMOVETYPE_FLY)
    
set_pev(iEntPEV_ENT_TIMEget_gametime() + 5.0)    // time remove
    
set_pev(iEntpev_classnamefire_classname)
    
engfunc(EngFunc_SetModeliEntfire_model_name)    //fire_model_name
    
set_pev(iEntpev_minsFloat:{-2.0, -2.0, -2.0})
    
set_pev(iEntpev_maxsFloat:{2.02.02.0})
    
set_pev(iEntpev_body2)
    
set_pev(iEntpev_originvfAttack)
    
set_pev(iEntpev_velocityvfVelocity)
    
set_pev(iEntpev_solidSOLID_BBOX)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_iuser21)
    
set_pev(iEntpev_vuser1vfVelocity)
    
set_pev(iEntpev_anglesvfAngle)
    
set_pev(iEntpev_v_anglevOfps)

    
set_pev(iEntpev_rendermodekRenderTransAdd)
    
set_pev(iEntpev_renderamt130.0)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(iEnt// entity
    
write_short(fire_spr_nameid// sprite
    
write_byte(8// life
    
write_byte(6// width
    
write_byte(RED// r
    
write_byte(GREEN// g
    
write_byte(BLUE// b
    
write_byte(180// brightness
    
message_end()
    
set_task(OFFSET_TIME_ATTACK"RemoveDisk"id+2242)
}

public 
RemoveDisk(taskid)
{
    
disc_opened[taskid-2242] = false;
    
remove_task(taskid)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
    return 
FMRES_IGNORED;

    static 
szClassName[33]
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName))

    if(!
equal(szClassName"weaponbox"))
    return 
FMRES_IGNORED;

    static 
iOwner

    iOwner 
entity_get_edict(entityEV_ENT_owner)

    if(
equal(model"models/w_m3.mdl"))
    {
        static 
iStoredSVDID

        iStoredSVDID 
find_ent_by_owner(ENG_NULLENTgWeaponentity)

        if(!
is_valid_ent(iStoredSVDID))
        return 
FMRES_IGNORED;

        if(
g_has_item[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_WEAPONKEYPOISON_WEAPONKEY)

            
g_has_item[iOwner] = false

            entity_set_model
(entityw_model)

            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_think(iEnt)
{
    if(!
pev_valid(iEnt)) 
    return

    new 
Float:fFrameFloat:fScaleFloat:fNextThink
    pev
(iEntpev_framefFrame)
    
pev(iEntpev_scalefScale)

    
// effect exp
    
new iMoveType pev(iEntpev_movetype)
    if (
iMoveType == MOVETYPE_NONE)
    {
        
fNextThink 0.015
        fFrame 
+= 1.0
        fScale 
floatmax(fScale1.55)

        if (
fFrame 21.0)
        {
            
engfunc(EngFunc_RemoveEntityiEnt)
            return
        }
    }

    
// effect normal
    
else
    {
        
fNextThink 0.045
        fFrame 
+= 1.0
        fFrame 
floatmin(21.0fFrame)
        
fScale += 0.2
        fScale 
floatmin(fScale1.75)
    }

    
set_pev(iEntpev_framefFrame)
    
set_pev(iEntpev_scalefScale)
    
set_pev(iEntpev_nextthinkget_gametime() + fNextThink)

    
// time remove
    
static Float:fTimeRemove
    pev
(iEntpev_fuser1fTimeRemove)
    if (
get_gametime() >= fTimeRemove)
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
        return;
    }
}

public 
fw_remove_poison(taskEnt)
{
    new 
Ent=taskEnt-1234
    
if(is_valid_ent(Ent)) engfunc(EngFunc_RemoveEntityEnt)
    
remove_task(taskEnt)
}

public 
fw_touch_poison(enttouch)
{
    
client_print(0print_center"Touch")
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()

        if(
CurTime 1.0 g_poison_touch[touch])
        {
            new 
Owner pev(entpev_owner)
            
ExecuteHamB(Ham_TakeDamagetouchOwnertouch50.0DMG_BLAST)
            
set_pev(touchpev_maxspeed20.0)    

            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
fw_touch_shot(entid)
{
    
emit_sound(entCHAN_ITEMg_sound[3], 1.0ATTN_NORM0PITCH_NORM)
    new 
Float:vOrigin[3]
    
pev(entpev_originvOrigin);

    new 
classname[1024]
    
pev(idpev_classnameclassnamecharsmax(classname))
    if(
equal(classname"func_wall") || equal(classname"func_breakable") || equal(classname"worldspawn")) {
        new 
Gent create_entity("info_target")

        
set_pev(Gentpev_ownerpev(entpev_owner))
        new 
Float:maxs[3] = {40.040.025.0}
        new 
Float:mins[3] = {-40.0, -40.0, -25.0}
        
entity_set_size(Gentminsmaxs)
        
set_pev(Gentpev_classnamepoison_classname)
        
engfunc(EngFunc_SetModelGentfire_poison)

        new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];

        
pev(entget_pcvar_num(cvar_movetype) ? pev_velocity pev_vuser1vTraceDirection)

        
xs_vec_add(vTraceDirectionvOriginvTraceEnd);

        
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSent0);

        new 
Float:fFraction;
        
get_tr2(0TR_flFractionfFraction);

        
// -- We hit something!
        
if(fFraction 1.0)
        {
            
// -- Save results to be used later.
            
get_tr2(0TR_vecEndPosvTraceEnd);

            
get_tr2(0TR_vecPlaneNormalvNormal);
        }
        
xs_vec_add(vTraceEndvNormalvNewOrigin);

        
vector_to_angle(vNormal,vEntAngles);
        
vEntAngles[0]-=90.0

        set_pev
(Gent,pev_angles,vEntAngles);
        
set_pev(Gentpev_originvNewOrigin)

        
set_pev(Gentpev_rendermodekRenderTransAdd)
        
set_pev(Gentpev_renderamt160.0)

        
set_pev(Gentpev_solidSOLID_SLIDEBOX)
        
set_pev(Gentpev_movetypeMOVETYPE_NONE)

        
effect_play_sprite(vOrigin40.0)

        
set_task(TIME_POISON"fw_remove_poison"Gent+1234)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(!
is_valid_ent(id))
    return 
FMRES_IGNORED

    
if(!is_user_alive(id) || !is_user_connected(id)) {
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    if(
pev(entpev_iuser2) == 1)
    {
        
set_pev(entpev_iuser20)
        
pev(idpev_originvOrigin)
        
effect_play_sprite(vOrigin30.0)

        
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        
write_byteTE_SPRITETRAIL // Throws a shower of sprites or models
        
write_coordfloatround(vOrigin]) ) // start pos
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) ) // velocity
        
write_coordfloatround(vOrigin]) )
        
write_coordfloatround(vOrigin]) +20)
        
write_short(sprite_ability // spr
        
write_byte(18// (count)
        
write_byte(random_num(8,15)) // (life in 0.1's)
        
write_byte(4// byte (scale in 0.1's)
        
write_byte(random_num(22,35)) // (velocity along vector in 10's)
        
write_byte(20// (randomness of velocity in 10's)
        
message_end()

        static 
attacker

        attacker 
pev(entpev_owner)

        if(!
fm_get_user_godmode(id)) {
            new 
Float:velocity[3]
            
pev(entpev_vuser1velocity)
            
velocity[2]+=30.0
            xs_vec_mul_scalar
(velocity1000.0/xs_vec_len(velocity), velocity)

            
ExecuteHam(Ham_TakeDamageid"poison_launcher"attackerrandom_float(get_pcvar_float(cvar_start_damage), get_pcvar_float(cvar_end_damage)), DMG_BULLET)
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("Damage"), _id)
            
write_byte(0// damage save
            
write_byte(0// damage take
            
write_long(DMG_POISON// damage type
            
write_coord(0// x
            
write_coord(0// y
            
write_coord(0// z
            
message_end()

            
user_screen_shake(id425)
            
do_screen_fade(id0.80.7REDGREENBLUE180);

            
set_pev(idpev_velocityvelocity)
            
gPoisonGlow[id] = get_gametime() + 1.0;
            
gGlowPlayer[id] = true;

            
fm_set_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal25)
        }
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED
}


public 
client_PostThink(id)
{
    if (!
is_user_alive(id)) return;

    if(
gGlowPlayer[id]) {
        if(
gPoisonGlow[id]>get_gametime())
        return

        
set_pev(idpev_maxspeed100.0// prevent from moving
        
set_pev(idpev_renderfx0)    
        
gGlowPlayer[id] = false;    
    }
}

effect_play_sprite(const Float:vOrigin[3], Float:Add)
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordvOrigin[0])
    
engfunc(EngFunc_WriteCoordvOrigin[1])
    
engfunc(EngFunc_WriteCoordvOrigin[2] + Add)
    
write_short(fire_spr_id)
    
write_byte(8)
    
write_byte(200)
    
message_end()
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    static 
weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    
replace_weapon_models(ownerweaponid)
}

replace_weapon_models(idweaponid)
{
    switch (
weaponid)
    {
        case 
CSW_WPN_POISON:
        {
            
//if (!avp_get_user_predator(id))
            //    return

            
if(g_has_item[id])
            {
                
set_pev(idpev_viewmodel2v_model)
                
set_pev(idpev_weaponmodel2p_model)
                
UTIL_PlayWeaponAnimation (idDRAW_ANIM)
                
emit_sound(idCHAN_WEAPONg_sound[0], 1.0ATTN_NORM0PITCH_NORM)
                
//set_pdata_float(id, m_flNextAttack, 1.3, PLAYER_LINUX_XTRA_OFF)
            
}
        }
    }
    
oldweap[id] = weaponid
}

public 
plasma_ItemPostFrame(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    iClipExtra 
get_pcvar_num(cvar_clip)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if( 
fInReload && flNextAttack <= 0.0 )
    {
        new 
min(iClipExtra iClipiBpAmmo)

        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
cs_set_user_bpammo(idCSW_WPN_POISONiBpAmmo-j)

        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)
        
fInReload 0
    
}
    return 
HAM_IGNORED
}

public 
fw_Reload(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)
    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
static iClipExtra

    
if(g_has_item[id])
    
iClipExtra get_pcvar_num(cvar_clip)

    
g_TmpClip[id] = -1

    
new iBpAmmo cs_get_user_bpammo(idCSW_WPN_POISON)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)

    if (
iBpAmmo <= 0)
    return 
HAM_SUPERCEDE

    
if (iClip >= iClipExtra)
    return 
HAM_SUPERCEDE

    g_TmpClip
[id] = iClip

    
return HAM_IGNORED
}

public 
Reload_Post(weapon_entity
{
    new 
id pev(weapon_entitypev_owner)

    if (!
is_user_connected(id))
    return 
HAM_IGNORED

    
if (!g_has_item[id])
    return 
HAM_IGNORED

    
if (g_TmpClip[id] == -1)
    return 
HAM_IGNORED

    set_pdata_int
(weapon_entitym_iClipg_TmpClip[id], WEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entitym_flTimeWeaponIdleWPN_RELOAD_TIMEWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(idm_flNextAttackWPN_RELOAD_TIMEPLAYER_LINUX_XTRA_OFF)
    
set_pdata_int(weapon_entitym_fInReload1WEAP_LINUX_XTRA_OFF)
    
UTIL_PlayWeaponAnimation(idRELOAD_ANIM)

    return 
HAM_IGNORED
}

stock fm_cs_get_current_weapon_ent(id)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    return 
get_pdata_cbase(ent414)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

user_screen_shake(idamplitude 4duration 2frequency 10)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short((1<<12)*amplitude// ??
    
write_short((1<<12)*duration// ??
    
write_short((1<<12)*frequency// ??
    
message_end()
}

stock do_screen_fadeidFloat:fadeTimeFloat:holdTimeredgreenbluealphatype 0x0000 )
{
    static 
msgScreenFade;
    if ( !
msgScreenFade ) { msgScreenFade get_user_msgid"ScreenFade" ); }
    new 
fadehold;
    
fade clampfloatroundfadeTime float(1<<12)), 00xFFFF );
    
hold clampfloatroundholdTime float(1<<12)), 00xFFFF );
    
message_beginMSG_ONE_UNRELIABLEmsgScreenFade_id );
    
write_shortfade );
    
write_shorthold );
    
write_shorttype );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end( );
}

stock get_weapon_attackment(idFloat:output[3], Float:fDis 40.0)
{
     
    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3
    
IVecFVec(viEndvfEnd

    new 
Float:fOrigin[3], Float:fAngle[3]

    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)

    
xs_vec_add(fOriginfAnglefOrigin

    new 
Float:fAttack[3]

    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack

    new 
Float:fRate

    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)

    
xs_vec_add(fOriginfAttackoutput)
}

stock drop_weapons(iddropwhat)
{
    static 
weapons[32], numiweaponid
    num 
0
    get_user_weapons
(idweaponsnum)

    for (
0numi++)
    {
        
weaponid weapons[i]

        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamesizeof wname 1)
            
engclient_cmd(id"drop"wname)
        }
    }


Listo, en la consola pones "obtener_arma" y te va a dar el arma.

Responder