SOLUCIONADO no le haga efecto un plugin a otro plugin
#1
buenas quisiera que este plugin no le haga efecto a otro osea tengo un plugin de una bazooka y este tiene 10 cargadores pero con este plugin se los aumenta a 90 y son infinitas entonces quisiera que este plugin no le hiciera el efecto al plugin de la bazooka

Código PHP:
#define NE_UA_VERSION "1.0.0"

/*
    New-Era_UnlimitedAmmo by New-Era Scripting Team members:
        Alican Çubukçuoðlu (AKA AlicanC and Shaman)Xoxo Sneaky
    
    You can reach us from Steam Community group "#n.E Scripting Team"
*/
#include <amxmodx>
#include <amxmisc>

#include <cstrike>
#include <fakemeta>

#define find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

new ne_uammo_enable
new CSW_MAXAMMO[33]=
{
    -
2,
    
52,
    
0,
    
90,
    
1,
    
32,
    
1,
    
100,
    
90,
    
1,
    
120,
    
100,
    
100,
    
90,
    
90,
    
90,
    
100,
    
120,
    
30,
    
120,
    
200,
    
32,
    
90,
    
120,
    
90,
    
2,
    
35,
    
90,
    
90,
    
0,
    
100,
    -
1,
    -
1
}

public 
plugin_init()
{
    
register_plugin("New-Era_UnlimitedAmmo"NE_UA_VERSION"New-Era Scripting Team")
    
register_cvar("ne_uammo_version"NE_UA_VERSIONFCVAR_SPONLY)

    
ne_uammo_enable        =    register_cvar("ne_uammo_enable""1")

    
register_event("CurWeapon""event_curweapon""be""1=1")
    
register_clcmd("ne_uammo""command_ne_uammo"_"Dispays information about New-Era_UnlimitedAmmo")
}

public 
event_curweapon(id)
{
    if(!
get_pcvar_num(ne_uammo_enable) || !is_user_alive(id))
        return 
0

    
new weaponID read_data(2)
    if(
weaponID == CSW_C4 || weaponID == CSW_KNIFE || weaponID == CSW_HEGRENADE || weaponID == CSW_SMOKEGRENADE || weaponID == CSW_FLASHBANG)
        return 
PLUGIN_CONTINUE;
    
    
cs_set_user_bpammo(idweaponIDCSW_MAXAMMO[weaponID])
    
    return 
0

Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#2
pone el plugin de bazooka
Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#3
(10/01/2019, 01:10 AM)[R]ak escribió: pone el plugin de bazooka

Código PHP:
#include < amxmodx >
#include < cstrike >
#include < engine > 
#include < fakemeta >
#include < hamsandwich >
//#include < zombieplague >

new const PLUGIN_VERSION[ ]    =  "0.0.1";

const 
OFFSET_WEAPONOWNER    =      41
const OFFSET_LINUX    =    5
const OFFSET_LINUX_WEAPONS     =      4

const WEAP_KEY   =    545464464
const MAX_PLAYERS   =        32

const m_iClip            =        51
const m_flNextAttack        =        83
const m_flNextPrimaryAttack    =    46

enum _
:Coord_e 

    
Float:x,
    
Float:y
    
Float:
};

enum ( <<= 

    
angles 1
    
v_angle
    
punchangle 
};

enum _:Angle_e 

    
Float:pitch
    
Float:yaw
    
Float:roll 
};

enum ( <<=)
{
    
DROP_PRIMARY 1,
    
DROP_SECONDARY
};

enum _:OTHERS
{
    
TRAIL 
    
DECALINDEX 
    
EXPLODESPR 
    
PUFFSPR  
}    

enum eState:
{
    
State_Shown 0,
    
State_Hidden
};

const 
IDLE 
const RELOAD 3
const DRAW 4
const SHOOT_1 1
const SHOOT_2 

#define write_coord_f(%1)    engfunc(EngFunc_WriteCoord,%1)
#define HoldCBaseWeapon(%0)    ( get_user_weapon( %0 ) == g_iWeaponID  && g_pWeaponA[ %0 ] )
#define IsValidPrivateData(%0)    ( pev_valid( %0 ) == 2 )

#define VectorScale(%1,%2,%3)    ( %3[ x ] = %2 * %1[ x ], %3[ y ] = %2 * %1[ y ], %3[ z ] = %2 * %1[ z ] )
#define VectorAdd(%1,%2,%3)      ( %3[ x ] = %1[ x ] + %2[ x ], %3[ y ] = %1[ y ] + %2[ y ], %3[ z ] = %1[ z ] + %2[ z ] )

new const WEAPON_SOUND_FIRE[ ] = "weapons/at4-1.wav";

new const 
WEAPON_LIST[ ]   =   "weapon_at4cs_sh";
new const 
WEAPON_BASE_NAME[ ]   =  "weapon_sg552";

const 
Float:RELOAD_TIME  =   4.0

const AMMO__WEAPON        =  10 
const CLIP__WEAPON  =  
const COST__GRENADE   =  200 

const Float:ROCKET__DAMAGE   =   1000.0
const Float:ROCKET__RADIUS 300.0
const Float:ROCKET__SPEED    1600.0

new const EXTRA_ITEM_NAME[ ]    =   "AT4CS";

new 
V_MODEL[ ] = "models/insurgentes_mdl/v_at4ex.mdl";
new 
P_MODEL[ ] = "models/insurgentes_mdl/p_at4ex.mdl";
new 
W_MODEL[ ] = "models/insurgentes_mdl/w_weapons.mdl";

new 
R_MODEL[ ] = "models/insurgentes_mdl/s_rocket.mdl"

new const BUYAMMO_SOUND[ ] = "items/9mmclip1.wav";

new const 
HUD_SPRITES[ ] [ ] = 
{
    
"sprites/zm/640hud7.spr" 
    
"sprites/zm/640hud53.spr" 
    
"sprites/zm/at4_scope.spr" 
}    

new 
g_iItem g_iOriginEvent g_iMaxPlayers g_iForwardIndex;


new 
g_iEffectOTHERS ]; 

new 
g_pWeaponAMAX_PLAYERS ] , 
    
bool:g_iPrimaryAttack;
    
new 
g_iClipAmmoMAX_PLAYERS ], 
    
g_TmpClipMAX_PLAYERS ] , 
    
g_iWeaponID 0;
    
const 
HIDE_CROSSHAIR = ( << );    

new const 
ROCKET__CLASSNAME[ ]  =   "Rocket_at";    

const 
WEAPONS_PRIMARY_BITSUM     = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const 
WEAPONS_SECONDARY_BITSUM     = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

public 
plugin_precache()
{
    
precache_model(V_MODEL);
    
precache_model(P_MODEL);
    
precache_model(W_MODEL);
    
precache_model(R_MODEL);
    
    
PrecacheSoundsFromModelV_MODEL );
    
    
precache_sound(WEAPON_SOUND_FIRE);
    
    static 
iFile
    
    
for( iFile iFile sizeof HUD_SPRITESiFile++ ) 
    {
        
precache_genericHUD_SPRITESiFile ] )
    }    
    
    static 
szFile 64 ];
    
    
formatex szFile charsmaxszFile ) , "sprites/%s.txt" WEAPON_LIST );
    
precache_genericszFile );
    
    
precache_soundBUYAMMO_SOUND 
    
    
g_iEffectEXPLODESPR ]  = precache_model"sprites/zm/zerogxplode-big1.spr"  )
    
g_iEffectTRAIL ] = precache_model("sprites/xbeam3.spr")
    
g_iEffectPUFFSPR ]  = precache_model("sprites/effects/rainsplash.spr")
    
    
g_iForwardIndex register_forwardFM_PrecacheEvent"Forward_PrecacheEventPost"true );
}

public 
plugin_init()
{
    
register_plugin"[CSO] Extra Item Ethereal" PLUGIN_VERSION "Shurik07" );
    
register_clcmdWEAPON_LIST"weapon_hook_an" );
    
    
unregister_forwardFM_PrecacheEventg_iForwardIndextrue );
    
register_forward(FM_SetModel"Forward_SetModel" false );
    
register_forward(FM_PlaybackEvent"Forward_PlayBackEvent" false )
    
register_forward(FM_UpdateClientData"Forward_UpdateClientData" true );
    
    
RegisterHamHam_Item_AddToPlayerWEAPON_BASE_NAME"CBaseWeapon__AddToPlayer__Pre" , .Post false );
    
RegisterHamHam_Item_DeployWEAPON_BASE_NAME "CBaseWeapon__Deploy__Post", .Post true );
    
RegisterHamHam_Item_HolsterWEAPON_BASE_NAME"CBaseWeapon_Holster_Post", .Post true );
    
RegisterHamHam_Weapon_PrimaryAttackWEAPON_BASE_NAME"CBaseWeapon__PrimaryAttack__Pre" , .Post false );
    
RegisterHamHam_Weapon_PrimaryAttackWEAPON_BASE_NAME"CBaseWeapon_PrimaryAttack_Post", .Post true );
    
RegisterHamHam_Item_PostFrameWEAPON_BASE_NAME"CBaseWeapon__PostFrame__Pre" , .Post false );
    
RegisterHamHam_Weapon_ReloadWEAPON_BASE_NAME"CBaseWeapon__Reload_Pre" , .Post false );
    
RegisterHamHam_Weapon_ReloadWEAPON_BASE_NAME"CBaseWeapon__Reload_Post", .Post true );
    
    
server_cmd("cartucho.amxx");


    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack"0)
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack"0)
    
    
register_touchROCKET__CLASSNAME "*""CTouch_Rocket" )
    
register_thinkROCKET__CLASSNAME "CThink_Rocket" )
    
    
    
g_iEffectDECALINDEX ]   = get_decal_index("{scorch3")

    
//g_iItem = zp_register_extra_item( EXTRA_ITEM_NAME, 150, ZP_TEAM_HUMAN );
    
g_iMaxPlayers get_maxplayers();
    
g_iWeaponID get_weaponidWEAPON_BASE_NAME );
}

public 
fw_TraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], PtrDamageBits)
{
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED    
    
if(get_user_weapon(Attacker) != CSW_G3SG1 || !g_pWeaponA[Attacker])
        return 
HAM_IGNORED
        
    
return HAM_SUPERCEDE
}

public 
plugin_natives()
{
    
register_native("get_at4cs""native_zp_extra_item_selected"1)
}

public 
native_zp_extra_item_selectedpPlayer pItem )
{
    
zp_extra_item_selectedpPlayer pItem )
}

public 
zp_extra_item_selectedpPlayer pItem )
{
    if( 
pItem == g_iItem  )
    {
         
UTIL__DropWeaponspPlayerDROP_PRIMARY )
         
         
g_pWeaponApPlayer ]  = true;
         
         static 
pEntity;
         
         
pEntity fm_give_itempPlayer WEAPON_BASE_NAME ); 
         
         if( 
pEntity )
         {
            
cs_set_weapon_ammopEntityCLIP__WEAPON );    
         }    
         
         
cs_set_user_bpammopPlayer g_iWeaponID AMMO__WEAPON );
         
         
UTIL__WeaponListpPlayer,  WEAPON_LIST 90 , -, -10 g_iWeaponID );
    }    
}

public 
weapon_hook_anpPlayer  
{
        
engclient_cmdpPlayerWEAPON_BASE_NAME);
        return 
PLUGIN_HANDLED;
}

public 
zp_user_humanized_postpPlayer )
{
    
g_pWeaponApPlayer ] = false;
}

public 
client_disconnectpPlayer )
{
    
g_pWeaponApPlayer ]  = false;
}

public 
Forward_PrecacheEventPost(type, const pName[ ] )
{
    if ( 
equal ("events/sg552.sc"pName ) )
    {
        
g_iOriginEvent get_orig_retval( );
        return 
FMRES_HANDLED;
    }
    return 
FMRES_IGNORED;
}

public 
Forward_SetModelpEntitypModel[])
{
    if( !
is_valid_entpEntity ) ) 
    {
        return 
FMRES_IGNORED;
    }    
    
    static 
szClassName 33 ]
    
entity_get_stringpEntityEV_SZ_classnameszClassNamecharsmax szClassName ) )
        
    if( !
equal szClassName"weaponbox" ) )
    {
        return 
FMRES_IGNORED;
    }    
    
    static 
pOwner pModel
    
    pModel 
find_ent_by_owner ( -1WEAPON_BASE_NAMEpEntity );
    
    
pOwner entity_get_edict(pEntityEV_ENT_owner)
    
    if ( 
g_pWeaponA pOwner ]  && is_valid_ent pModel ) )
    {
        
entity_set_intpModelEV_INT_impulseWEAP_KEY);
        
        
entity_set_modelpEntityW_MODEL );
        
set_pev(pEntitypev_body22)

        
g_pWeaponA pOwner ]   = false;
        
        return 
FMRES_SUPERCEDE;
    }

    return 
FMRES_IGNORED;
}

public 
Forward_UpdateClientDatapPlayer SendWeaponsCD_Handle )
{
    if ( !
HoldCBaseWeaponpPlayer ) )
    {
        return 
HAM_IGNORED;
    }

    static 
Float:fGametime;
    
fGametime get_gametime();
    
    
set_cd CD_HandleCD_flNextAttackfGametime 0.001 );

    return 
FMRES_HANDLED;
}

public 
Forward_PlayBackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:fvangles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ( ( 
eventid != g_iOriginEvent) || !g_iPrimaryAttack )
    {
        return 
FMRES_IGNORED;
    }    
        
    if (!( 
<= invoker <= g_iMaxPlayers ) )
    {
        return 
FMRES_IGNORED;
    }    
    
    if( 
flags FEV_GLOBAL )
    {    
        
flags &= ~FEV_GLOBAL;
    }

    
playback_event(flags FEV_HOSTONLYinvokereventiddelayoriginfvanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
CBaseWeapon__AddToPlayer__PrepEnity pPlayer )
{
    if( !
pev_validpEnity ) && !is_user_connectedpPlayer ) ) 
    {
         return 
HAM_IGNORED;
    }
    
    if( 
pevpEnitypev_impulse ) == WEAP_KEY || g_pWeaponApPlayer ] )
    {
        
g_pWeaponApPlayer ]  = true;
        
        
UTIL__WeaponListpPlayer,  WEAPON_LIST 90 , -, -10 g_iWeaponID );

        return 
HAM_HANDLED;
    }
    else
    {
        
UTIL__WeaponListpPlayer,  WEAPON_BASE_NAME 90 , -, -10 g_iWeaponID );
    }    

    return 
HAM_IGNORED;
}

public 
CBaseWeapon__Deploy__PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }
    
    static 
pId 
    pId 
get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );
    
    if (!
g_pWeaponA[pId]  )
    {
        return 
HAM_IGNORED;
    }    
    
    
set_pev(pIdpev_viewmodel2V_MODEL);
    
set_pev(pIdpev_weaponmodel2P_MODEL);
    
    
set_pdata_floatpIdm_flNextAttack1.0OFFSET_LINUX);
    
    
UTIL__SetCrosshairStatuspIdState_Hidden  )
    
UTIL_SenwWeaponAnimpIdDRAW );
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon_Holster_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pPlayer;

    
pPlayer get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    
UTIL__SetCrosshairStatuspPlayerState_Shown );

    if ( !
HoldCBaseWeaponpPlayer ) )
    {
        return 
HAM_IGNORED;
    }

    return 
HAM_IGNORED;
}

public 
CBaseWeapon__PrimaryAttack__Pre(pEntity)
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_IGNORED;
    }

    static     
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    
g_iClipAmmo[pId] = cs_get_weapon_ammo(pEntity);

    
g_iPrimaryAttack true;
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon_PrimaryAttack_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_IGNORED;
    }
    
g_iPrimaryAttack false;
    
    static 
pId pId get_pdata_cbasepEntityOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS );
    
    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    if (!
g_iClipAmmo[pId])
    {
            return 
HAM_IGNORED;
    }    
        
        
    
client_cmd(pId"spk %s"WEAPON_SOUND_FIRE)
    
UTIL_SenwWeaponAnimpIdrandom_numSHOOT_1 SHOOT_2 ) );
    
    static 
Float:vf_ForwardCoord_e ], Float:vf_vAngleAngle_e ];
    static 
Float:vf_Source Coord_e ], Float:vf_AnglesCoord_e ];
    
    
engfuncEngFunc_GetAttachmentpId0vf_Sourcevf_Angles )

    
global_get glb_v_forwardvf_Forward );
    
pev pIdpev_v_anglevf_vAngle );
    
    
set_pevpId pev_punchangle Float:{ 3.2 3.2 0.0 } ); 

    static 
Float:vf_VelocitySRCoord_e ]
    
    
VectorScale vf_ForwardROCKET__SPEED vf_VelocitySR );
    
GLauncher_ShootRocket vf_Sourcevf_VelocitySRpId );
    
    return 
HAM_IGNORED;
}

GLauncher_ShootRocket ( const Float:vf_Origin[], const Float:vf_Velocity[], const i_Owner )
{
    static 
i_Rocket;

    if ( ( 
i_Rocket engfunc EngFunc_CreateNamedEntityengfunc EngFunc_AllocString"info_target" ) ) ) )
    {
        static 
vf_TempAngle_e ]

        
set_pev i_Rocketpev_classnameROCKET__CLASSNAME );
        
set_pev i_Rocketpev_originvf_Origin );
        
set_pev i_Rocketpev_owneri_Owner );

        
set_pev i_Rocketpev_movetypeMOVETYPE_FLYMISSILE );
        
set_pev i_Rocketpev_solidSOLID_BBOX );
        
set_pev i_Rocketpev_takedamageDAMAGE_NO );
        
set_pev i_Rocketpev_gravity0.5 );
        
        
engfunc EngFunc_VecToAnglesvf_Velocityvf_Temp );
        
set_pev i_Rocketpev_anglesvf_Temp );
        
        
engfunc EngFunc_ParticleEffectvf_Originvf_Velocity8.0 25.0 )

        
engfunc EngFunc_SetModel i_RocketR_MODEL );
        
engfunc EngFunc_SetSize  i_RocketFloat:{ 0.00.00.0 }, Float:{ 0.00.00.0 } );
        
engfunc EngFunc_SetOrigini_Rocketvf_Origin );

        
set_pev i_Rocketpev_velocityvf_Velocity );
        
        
FX_BeamFollow i_Rocketg_iEffectTRAIL ] , 25725500200 );    
        
        
set_pev(i_Rocketpev_nextthinkget_gametime( ) + 0.1)
    }
}

public 
CBaseWeapon__PostFrame__PrepEntity 
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
is_user_connectedpId ) && !HoldCBaseWeaponpId ) && !g_iMaxPlayers )
    {
        return 
HAM_HANDLED;
    }
    
    new 
fInReload get_pdata_intpEntity54OFFSET_LINUX_WEAPONS );
    new 
Float:flNextAttack get_pdata_floatpIdm_flNextAttackOFFSET_LINUX_WEAPONS );
    new 
iClip  get_pdata_intpEntitym_iClipOFFSET_LINUX_WEAPONS );
    new 
iAmmoType 376 get_pdata_intpEntity49OFFSET_LINUX_WEAPONS );
    new 
iBpAmmo  get_pdata_intpIdiAmmoTypeOFFSET_LINUX );
    
    if ( 
fInReload && flNextAttack <= 1.4 )
    {
        new 
minCLIP__WEAPON  iClipiBpAmmo);
    
        
set_pdata_intpEntitym_iClipiClip jOFFSET_LINUX_WEAPONS );
        
set_pdata_intpIdiAmmoTypeiBpAmmo-jOFFSET_LINUX );
        
set_pdata_intpEntity540OFFSET_LINUX_WEAPONS );

        
fInReload 0;
    }     
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon__Reload_Pre(pEntity
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_HANDLED;
    }

    static 
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
is_user_connectedpId ) || !HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iClipExtra;
    
iClipExtra CLIP__WEAPON ;
    
    
g_TmpClip[pId] = -1;
    
    new 
iAmmoType 376 get_pdata_intpEntity49OFFSET_LINUX_WEAPONS );
    new 
iBpAmmo get_pdata_intpIdiAmmoTypeOFFSET_LINUX );
    new 
iClip get_pdata_intpEntitym_iClipOFFSET_LINUX );
    
    if ( 
iBpAmmo <= || iClip >= iClipExtra )
    {
       return 
HAM_SUPERCEDE;
    }  
    
    
g_TmpClip[pId] = iClip;
    
    return 
HAM_HANDLED;
}

public 
CBaseWeapon__Reload_PostpEntity 
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pId pId  get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );
    
    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    if (
g_TmpClippId ] == -1)
    {
        return 
HAM_IGNORED;
    }
    
    
set_pdata_floatpIdm_flNextAttackRELOAD_TIME OFFSET_LINUX);
    
    
UTIL_SenwWeaponAnim(pIdRELOAD);

    return 
HAM_HANDLED;
}

public 
CTouch_Rocket(pEntityid)
{
    if( !
pev_validpEntity ) )
    {
        return;
    }

    static 
Float:flOriginCoord_e ];
    
pevpEntitypev_originflOrigin );
    
    
set_pev(pEntitypev_movetypeMOVETYPE_NONE)
    
set_pev(pEntitypev_solidSOLID_NOT)    
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_EXPLOSION)
    
write_coord_f(  flOrigin[x])
    
write_coord_f(  flOrigin[y])
    
write_coord_fflOrigin[z] +50.0 )
    
write_short(g_iEffectEXPLODESPR ] )
    
write_byte50 )
    
write_byte30 )
    
write_byte)
    
message_end()

    
message_begin(MSG_ALLSVC_TEMPENTITY
    
write_byte(TE_WORLDDECAL)
    
write_coord_f(flOrigin[x])
    
write_coord_fflOrigin[y])
    
write_coord_fflOrigin[z])
    
write_byte(g_iEffectDECALINDEX ] )
    
message_end()

    new 
pOwner pevpEntitypev_owner );
       
    static 
pevVictimFloat:flDistance,Float:fDamage;
                       
    
pevVictim  = -1;
       
    while( ( 
pevVictim engfuncEngFunc_FindEntityInSpherepevVictimflOriginROCKET__RADIUS) ) != )
    {
            if( !
is_user_alivepevVictim ) )
                    continue;

            
//if( !zp_get_user_zombie( pevVictim ) )
            //    continue;

            
flDistance entity_rangepEntitypevVictim );

            
fDamage UTIL_FloatRadiusROCKET__DAMAGEROCKET__RADIUS flDistance );


            if( 
fDamage 0.0 )
            {
                    
ExecuteHamBHam_TakeDamagepevVictimpEntitypOwnerfDamageDMG_BULLET DMG_ALWAYSGIB);

            }

            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("ScreenFade"), {0,0,0}, pevVictim )
            
write_short(1<<10)
            
write_short(1<<10)
            
write_short(0x0000)
            
write_byte(200)
            
write_byte(0)
            
write_byte(0)
            
write_byte(75)
            
message_end()
    }
       
    
engfuncEngFunc_RemoveEntitypEntity );
}

Float:UTIL_FloatRadiusFloat:flMaxAmountFloat:flRadiusFloat:flDistance )
{
        return 
floatsubflMaxAmountfloatmulfloatdivflMaxAmountflRadius ), flDistance ) );
}

public 
CThink_RocketiRocket )
{
    if(!
pev_validiRocket ))
    {
        return
    }    

    static 
Float:fOrigin[3]
    
peviRocket pev_originfOrigin)
        
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_SPRITE )
    
engfuncEngFunc_WriteCoordfOrigin[0] )
    
engfuncEngFunc_WriteCoordfOrigin[1] )
    
engfuncEngFunc_WriteCoordfOrigin[2] )
    
write_shortg_iEffectPUFFSPR ] ) 
    
write_byte
    
write_byte255 )
    
message_end( )
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byteTE_SPARKS 
    
engfuncEngFunc_WriteCoordfOrigin[0] )
    
engfuncEngFunc_WriteCoordfOrigin[1] )
    
engfuncEngFunc_WriteCoordfOrigin[2] )
    
message_end( )
        
    
set_peviRocket pev_nextthinkget_gametime( ) + 0.275 )
}

stock UTIL__DropWeapons(idbitsDropType)
{
    static 
weapons[32], numiweaponid
    num 

    get_user_weapons
(idweaponsnum)
    
    for (
0numi++)
    {
        
weaponid weapons[i]
        
        if ((
bitsDropType == DROP_PRIMARY && ((1<<weaponid) & WEAPONS_PRIMARY_BITSUM)) || (bitsDropType == DROP_SECONDARY && ((1<<weaponid) & WEAPONS_SECONDARY_BITSUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamecharsmax(wname))
            
            
engclient_cmd(id"drop"wname)
            
cs_set_user_bpammo(idweaponid0)
        }
    }
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) { /* keep looping */ }
    return 
entity;
}

stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
    
set_pev(pPlayerpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player pPlayer)
    
write_byte(Sequence)
    
write_byte(pev(pPlayerpev_body))
    
message_end()
}

UTIL__WeaponListpPlayer, const szWeapon[ ], intint2int3int4int5int6int7int8 )
{
    
message_beginMSG_ONEget_user_msgid"WeaponList" ) , _pPlayer );
    
write_stringszWeapon );
    
write_byte( int );
    
write_byteint2);
    
write_byteint3 );
    
write_byteint4 );
    
write_byteint5 );
    
write_byteint6 );
    
write_byteint7 );
    
write_byteint8 );
    
message_end( );
}

stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
    if (!
pev_valid(ent)) return 0;
    
    static 
Float:originF[3]
    
pev(idpev_originoriginF)
    
set_pev(entpev_originoriginF)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    static 
save
    save 
pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentid)
    if (
pev(entpev_solid) != save)
        return 
ent ;
    
    
engfunc(EngFunc_RemoveEntityent)
    
    return -
1;
}

FX_BeamFollow ( const i_Ent, const i_Trail, const i_Life, const i_Width, const i_Red, const i_Green, const i_Blue, const i_Brightness )
{
    
message_begin MSG_BROADCASTSVC_TEMPENTITY );
    
write_byte TE_BEAMFOLLOW );
    
write_short i_Ent );          // --| Enntity.
    
write_short i_Trail );        // --| Model.
    
write_byte i_Life );          // --| Life.
    
write_byte i_Width );         // --| Width.
    
write_byte i_Red );           // --| Red color.
    
write_byte i_Green );         // --| Green color.
    
write_byte i_Blue );          // --| Blue color.
    
write_byte i_Brightness );    // --| Brightness.
    
message_end ();
}

stock UTIL__SetCrosshairStatusPlayereState:mState )
{
    static 
afFlags
    afFlags 
0;
    
    if( 
mState == State_Hidden )
        
afFlags |= HIDE_CROSSHAIR;
    else
        
afFlags &= ~HIDE_CROSSHAIR;
    
    
message_beginMSG_ONEget_user_msgid"HideWeapon" ), _Player );
    
write_byteafFlags );
    
message_end( );
}


PrecacheSoundsFromModel(const szModelPath[])
{
    new 
iFile;
    
    if ((
iFile fopen(szModelPath"rt")))
    {
        new 
szSoundPath[64];
        
        new 
iNumSeqiSeqIndex;
        new 
iEventiNumEventsiEventIndex;
        
        
fseek(iFile164SEEK_SET);
        
fread(iFileiNumSeqBLOCK_INT);
        
fread(iFileiSeqIndexBLOCK_INT);
        
        for (new 
k0iNumSeqi++)
        {
            
fseek(iFileiSeqIndex 48 176 iSEEK_SET);
            
fread(iFileiNumEventsBLOCK_INT);
            
fread(iFileiEventIndexBLOCK_INT);
            
fseek(iFileiEventIndex 176 iSEEK_SET);

            for (
0iNumEventsk++)
            {
                
fseek(iFileiEventIndex 76 kSEEK_SET);
                
fread(iFileiEventBLOCK_INT);
                
fseek(iFile4SEEK_CUR);
                
                if (
iEvent != 5004)
                {
                    continue;
                }

                
fread_blocks(iFileszSoundPath64BLOCK_CHAR);
                
                if (
strlen(szSoundPath))
                {
                    
strtolower(szSoundPath);
                    
precache_sound(szSoundPath);
                }
            }
        }
    }
    
    
fclose(iFile);

Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#4
proba asi

Código PHP:
#define NE_UA_VERSION "1.0.0"

/*
New-Era_UnlimitedAmmo by New-Era Scripting Team members:
Alican Çubukçuoðlu (AKA AlicanC and Shaman)Xoxo Sneaky

You can reach us from Steam Community group "#n.E Scripting Team"
*/
#include <amxmodx>
#include <amxmisc>

#include <cstrike>
#include <fakemeta>
#include <engine>

#define find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

const CUSTOM_BAZOOKA_ID 7727

new ne_uammo_enable
new CSW_MAXAMMO[33]= {
    -
2,
    
52,
    
0,
    
90,
    
1,
    
32,
    
1,
    
100,
    
90,
    
1,
    
120,
    
100,
    
100,
    
90,
    
90,
    
90,
    
100,
    
120,
    
30,
    
120,
    
200,
    
32,
    
90,
    
120,
    
90,
    
2,
    
35,
    
90,
    
90,
    
0,
    
100,
    -
1,
    -
1
}

public 
plugin_init()
{
    
register_plugin("New-Era_UnlimitedAmmo"NE_UA_VERSION"New-Era Scripting Team")
    
register_cvar("ne_uammo_version"NE_UA_VERSIONFCVAR_SPONLY)
    
    
ne_uammo_enable        =    register_cvar("ne_uammo_enable""1")
    
    
register_event("CurWeapon""event_curweapon""be""1=1")
    
register_clcmd("ne_uammo""command_ne_uammo"_"Dispays information about New-Era_UnlimitedAmmo")
}

public 
event_curweapon(id)
{
    if(!
get_pcvar_num(ne_uammo_enable) || !is_user_alive(id))
        return 
0
    
    
new weaponID read_data(2), BazookaEnt find_ent_by_owner(-1"weapon_sg552"id)
    if(
weaponID == CSW_C4 || weaponID == CSW_KNIFE || weaponID == CSW_HEGRENADE || weaponID == CSW_SMOKEGRENADE || weaponID == CSW_FLASHBANG || (is_valid_ent(BazookaEnt) && entity_get_int(BazookaEntEV_INT_iuser1) == CUSTOM_BAZOOKA_ID && weaponID == CSW_SG552))
        return 
PLUGIN_CONTINUE;
    
    
cs_set_user_bpammo(idweaponIDCSW_MAXAMMO[weaponID])
    
    return 
0


Código PHP:
#include < amxmodx >
#include < cstrike >
#include < engine > 
#include < fakemeta >
#include < hamsandwich >
//#include < zombieplague >

new const PLUGIN_VERSION[ ]    =  "0.0.1";

const 
CUSTOM_BAZOOKA_ID 7727

const OFFSET_WEAPONOWNER    =      41
const OFFSET_LINUX    =    5
const OFFSET_LINUX_WEAPONS     =      4

const WEAP_KEY   =    545464464
const MAX_PLAYERS   =        32

const m_iClip            =        51
const m_flNextAttack        =        83
const m_flNextPrimaryAttack    =    46

enum _
:Coord_e 

    
Float:x,
    
Float:y
    
Float:
};

enum ( <<= 

    
angles 1
    
v_angle
    
punchangle 
};

enum _:Angle_e 

    
Float:pitch
    
Float:yaw
    
Float:roll 
};

enum ( <<=)
{
    
DROP_PRIMARY 1,
    
DROP_SECONDARY
};

enum _:OTHERS
{
    
TRAIL 
    
DECALINDEX 
    
EXPLODESPR 
    
PUFFSPR  
}    

enum eState:
{
    
State_Shown 0,
    
State_Hidden
};

const 
IDLE 
const RELOAD 3
const DRAW 4
const SHOOT_1 1
const SHOOT_2 

#define write_coord_f(%1)    engfunc(EngFunc_WriteCoord,%1)
#define HoldCBaseWeapon(%0)    ( get_user_weapon( %0 ) == g_iWeaponID  && g_pWeaponA[ %0 ] )
#define IsValidPrivateData(%0)    ( pev_valid( %0 ) == 2 )

#define VectorScale(%1,%2,%3)    ( %3[ x ] = %2 * %1[ x ], %3[ y ] = %2 * %1[ y ], %3[ z ] = %2 * %1[ z ] )
#define VectorAdd(%1,%2,%3)      ( %3[ x ] = %1[ x ] + %2[ x ], %3[ y ] = %1[ y ] + %2[ y ], %3[ z ] = %1[ z ] + %2[ z ] )

new const WEAPON_SOUND_FIRE[ ] = "weapons/at4-1.wav";

new const 
WEAPON_LIST[ ]   =   "weapon_at4cs_sh";
new const 
WEAPON_BASE_NAME[ ]   =  "weapon_sg552";

const 
Float:RELOAD_TIME  =   4.0

const AMMO__WEAPON        =  10 
const CLIP__WEAPON  =  
const COST__GRENADE   =  200 

const Float:ROCKET__DAMAGE   =   1000.0
const Float:ROCKET__RADIUS 300.0
const Float:ROCKET__SPEED    1600.0

new const EXTRA_ITEM_NAME[ ]    =   "AT4CS";

new 
V_MODEL[ ] = "models/insurgentes_mdl/v_at4ex.mdl";
new 
P_MODEL[ ] = "models/insurgentes_mdl/p_at4ex.mdl";
new 
W_MODEL[ ] = "models/insurgentes_mdl/w_weapons.mdl";

new 
R_MODEL[ ] = "models/insurgentes_mdl/s_rocket.mdl"

new const BUYAMMO_SOUND[ ] = "items/9mmclip1.wav";

new const 
HUD_SPRITES[ ] [ ] = 
{
    
"sprites/zm/640hud7.spr" 
    
"sprites/zm/640hud53.spr" 
    
"sprites/zm/at4_scope.spr" 
}    

new 
g_iItem g_iOriginEvent g_iMaxPlayers g_iForwardIndex;


new 
g_iEffectOTHERS ]; 

new 
g_pWeaponAMAX_PLAYERS ] , 
    
bool:g_iPrimaryAttack;
    
new 
g_iClipAmmoMAX_PLAYERS ], 
    
g_TmpClipMAX_PLAYERS ] , 
    
g_iWeaponID 0;
    
const 
HIDE_CROSSHAIR = ( << );    

new const 
ROCKET__CLASSNAME[ ]  =   "Rocket_at";    

const 
WEAPONS_PRIMARY_BITSUM     = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const 
WEAPONS_SECONDARY_BITSUM     = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

public 
plugin_precache()
{
    
precache_model(V_MODEL);
    
precache_model(P_MODEL);
    
precache_model(W_MODEL);
    
precache_model(R_MODEL);
    
    
PrecacheSoundsFromModelV_MODEL );
    
    
precache_sound(WEAPON_SOUND_FIRE);
    
    static 
iFile
    
    
for( iFile iFile sizeof HUD_SPRITESiFile++ ) 
    {
        
precache_genericHUD_SPRITESiFile ] )
    }    
    
    static 
szFile 64 ];
    
    
formatex szFile charsmaxszFile ) , "sprites/%s.txt" WEAPON_LIST );
    
precache_genericszFile );
    
    
precache_soundBUYAMMO_SOUND 
    
    
g_iEffectEXPLODESPR ]  = precache_model"sprites/zm/zerogxplode-big1.spr"  )
    
g_iEffectTRAIL ] = precache_model("sprites/xbeam3.spr")
    
g_iEffectPUFFSPR ]  = precache_model("sprites/effects/rainsplash.spr")
    
    
g_iForwardIndex register_forwardFM_PrecacheEvent"Forward_PrecacheEventPost"true );
}

public 
plugin_init()
{
    
register_plugin"[CSO] Extra Item Ethereal" PLUGIN_VERSION "Shurik07" );
    
register_clcmdWEAPON_LIST"weapon_hook_an" );
    
    
unregister_forwardFM_PrecacheEventg_iForwardIndextrue );
    
register_forward(FM_SetModel"Forward_SetModel" false );
    
register_forward(FM_PlaybackEvent"Forward_PlayBackEvent" false )
    
register_forward(FM_UpdateClientData"Forward_UpdateClientData" true );
    
    
RegisterHamHam_Item_AddToPlayerWEAPON_BASE_NAME"CBaseWeapon__AddToPlayer__Pre" , .Post false );
    
RegisterHamHam_Item_DeployWEAPON_BASE_NAME "CBaseWeapon__Deploy__Post", .Post true );
    
RegisterHamHam_Item_HolsterWEAPON_BASE_NAME"CBaseWeapon_Holster_Post", .Post true );
    
RegisterHamHam_Weapon_PrimaryAttackWEAPON_BASE_NAME"CBaseWeapon__PrimaryAttack__Pre" , .Post false );
    
RegisterHamHam_Weapon_PrimaryAttackWEAPON_BASE_NAME"CBaseWeapon_PrimaryAttack_Post", .Post true );
    
RegisterHamHam_Item_PostFrameWEAPON_BASE_NAME"CBaseWeapon__PostFrame__Pre" , .Post false );
    
RegisterHamHam_Weapon_ReloadWEAPON_BASE_NAME"CBaseWeapon__Reload_Pre" , .Post false );
    
RegisterHamHam_Weapon_ReloadWEAPON_BASE_NAME"CBaseWeapon__Reload_Post", .Post true );
    
    
server_cmd("cartucho.amxx");


    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack"0)
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack"0)
    
    
register_touchROCKET__CLASSNAME "*""CTouch_Rocket" )
    
register_thinkROCKET__CLASSNAME "CThink_Rocket" )
    
    
    
g_iEffectDECALINDEX ]   = get_decal_index("{scorch3")

    
//g_iItem = zp_register_extra_item( EXTRA_ITEM_NAME, 150, ZP_TEAM_HUMAN );
    
g_iMaxPlayers get_maxplayers();
    
g_iWeaponID get_weaponidWEAPON_BASE_NAME );
}

public 
fw_TraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], PtrDamageBits)
{
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED    
    
if(get_user_weapon(Attacker) != CSW_G3SG1 || !g_pWeaponA[Attacker])
        return 
HAM_IGNORED
        
    
return HAM_SUPERCEDE
}

public 
plugin_natives()
{
    
register_native("get_at4cs""native_zp_extra_item_selected"1)
}

public 
native_zp_extra_item_selectedpPlayer pItem )
{
    
zp_extra_item_selectedpPlayer pItem )
}

public 
zp_extra_item_selectedpPlayer pItem )
{
    if( 
pItem == g_iItem  )
    {
         
UTIL__DropWeaponspPlayerDROP_PRIMARY )
         
         
g_pWeaponApPlayer ]  = true;
         
         static 
pEntity;
         
         
pEntity fm_give_itempPlayer WEAPON_BASE_NAME ); 
         
         if( 
pEntity )
         {
            
cs_set_weapon_ammopEntityCLIP__WEAPON );    
         }    
         
         
cs_set_user_bpammopPlayer g_iWeaponID AMMO__WEAPON );
         
         
UTIL__WeaponListpPlayer,  WEAPON_LIST 90 , -, -10 g_iWeaponID );
    }    
}

public 
weapon_hook_anpPlayer  
{
        
engclient_cmdpPlayerWEAPON_BASE_NAME);
        return 
PLUGIN_HANDLED;
}

public 
zp_user_humanized_postpPlayer )
{
    
g_pWeaponApPlayer ] = false;
}

public 
client_disconnectpPlayer )
{
    
g_pWeaponApPlayer ]  = false;
}

public 
Forward_PrecacheEventPost(type, const pName[ ] )
{
    if ( 
equal ("events/sg552.sc"pName ) )
    {
        
g_iOriginEvent get_orig_retval( );
        return 
FMRES_HANDLED;
    }
    return 
FMRES_IGNORED;
}

public 
Forward_SetModelpEntitypModel[])
{
    if( !
is_valid_entpEntity ) ) 
    {
        return 
FMRES_IGNORED;
    }    
    
    static 
szClassName 33 ]
    
entity_get_stringpEntityEV_SZ_classnameszClassNamecharsmax szClassName ) )
        
    if( !
equal szClassName"weaponbox" ) )
    {
        return 
FMRES_IGNORED;
    }    
    
    static 
pOwner pModel
    
    pModel 
find_ent_by_owner ( -1WEAPON_BASE_NAMEpEntity );
    
    
pOwner entity_get_edict(pEntityEV_ENT_owner)
    
    if ( 
g_pWeaponA pOwner ]  && is_valid_ent pModel ) )
    {
        
entity_set_intpModelEV_INT_impulseWEAP_KEY);
        
        
entity_set_modelpEntityW_MODEL );
        
set_pev(pEntitypev_body22)

        
g_pWeaponA pOwner ]   = false;
        
        return 
FMRES_SUPERCEDE;
    }

    return 
FMRES_IGNORED;
}

public 
Forward_UpdateClientDatapPlayer SendWeaponsCD_Handle )
{
    if ( !
HoldCBaseWeaponpPlayer ) )
    {
        return 
HAM_IGNORED;
    }

    static 
Float:fGametime;
    
fGametime get_gametime();
    
    
set_cd CD_HandleCD_flNextAttackfGametime 0.001 );

    return 
FMRES_HANDLED;
}

public 
Forward_PlayBackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:fvangles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if ( ( 
eventid != g_iOriginEvent) || !g_iPrimaryAttack )
    {
        return 
FMRES_IGNORED;
    }    
        
    if (!( 
<= invoker <= g_iMaxPlayers ) )
    {
        return 
FMRES_IGNORED;
    }    
    
    if( 
flags FEV_GLOBAL )
    {    
        
flags &= ~FEV_GLOBAL;
    }

    
playback_event(flags FEV_HOSTONLYinvokereventiddelayoriginfvanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
CBaseWeapon__AddToPlayer__PrepEnity pPlayer )
{
    if( !
pev_validpEnity ) && !is_user_connectedpPlayer ) ) 
    {
         return 
HAM_IGNORED;
    }
    
    if( 
pevpEnitypev_impulse ) == WEAP_KEY || g_pWeaponApPlayer ] )
    {
        
g_pWeaponApPlayer ]  = true;
        
        
UTIL__WeaponListpPlayer,  WEAPON_LIST 90 , -, -10 g_iWeaponID );

        return 
HAM_HANDLED;
    }
    else
    {
        
UTIL__WeaponListpPlayer,  WEAPON_BASE_NAME 90 , -, -10 g_iWeaponID );
    }    

    return 
HAM_IGNORED;
}

public 
CBaseWeapon__Deploy__PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }
    
    static 
pId 
    pId 
get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );
    
    if (!
g_pWeaponA[pId]  )
    {
        return 
HAM_IGNORED;
    }    
    
    
set_pev(pIdpev_viewmodel2V_MODEL);
    
set_pev(pIdpev_weaponmodel2P_MODEL);
    
    
set_pdata_floatpIdm_flNextAttack1.0OFFSET_LINUX);
    
    
UTIL__SetCrosshairStatuspIdState_Hidden  )
    
UTIL_SenwWeaponAnimpIdDRAW );
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon_Holster_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pPlayer;

    
pPlayer get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    
UTIL__SetCrosshairStatuspPlayerState_Shown );

    if ( !
HoldCBaseWeaponpPlayer ) )
    {
        return 
HAM_IGNORED;
    }

    return 
HAM_IGNORED;
}

public 
CBaseWeapon__PrimaryAttack__Pre(pEntity)
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_IGNORED;
    }

    static     
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    
g_iClipAmmo[pId] = cs_get_weapon_ammo(pEntity);

    
g_iPrimaryAttack true;
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon_PrimaryAttack_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_IGNORED;
    }
    
g_iPrimaryAttack false;
    
    static 
pId pId get_pdata_cbasepEntityOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS );
    
    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    if (!
g_iClipAmmo[pId])
    {
            return 
HAM_IGNORED;
    }    
        
        
    
client_cmd(pId"spk %s"WEAPON_SOUND_FIRE)
    
UTIL_SenwWeaponAnimpIdrandom_numSHOOT_1 SHOOT_2 ) );
    
    static 
Float:vf_ForwardCoord_e ], Float:vf_vAngleAngle_e ];
    static 
Float:vf_Source Coord_e ], Float:vf_AnglesCoord_e ];
    
    
engfuncEngFunc_GetAttachmentpId0vf_Sourcevf_Angles )

    
global_get glb_v_forwardvf_Forward );
    
pev pIdpev_v_anglevf_vAngle );
    
    
set_pevpId pev_punchangle Float:{ 3.2 3.2 0.0 } ); 

    static 
Float:vf_VelocitySRCoord_e ]
    
    
VectorScale vf_ForwardROCKET__SPEED vf_VelocitySR );
    
GLauncher_ShootRocket vf_Sourcevf_VelocitySRpId );
    
    return 
HAM_IGNORED;
}

GLauncher_ShootRocket ( const Float:vf_Origin[], const Float:vf_Velocity[], const i_Owner )
{
    static 
i_Rocket;

    if ( ( 
i_Rocket engfunc EngFunc_CreateNamedEntityengfunc EngFunc_AllocString"info_target" ) ) ) )
    {
        static 
vf_TempAngle_e ]

        
set_pev i_Rocketpev_classnameROCKET__CLASSNAME );
        
set_pev i_Rocketpev_originvf_Origin );
        
set_pev i_Rocketpev_owneri_Owner );

        
set_pev i_Rocketpev_movetypeMOVETYPE_FLYMISSILE );
        
set_pev i_Rocketpev_solidSOLID_BBOX );
        
set_pev i_Rocketpev_takedamageDAMAGE_NO );
        
set_pev i_Rocketpev_gravity0.5 );
        
        
engfunc EngFunc_VecToAnglesvf_Velocityvf_Temp );
        
set_pev i_Rocketpev_anglesvf_Temp );
        
        
engfunc EngFunc_ParticleEffectvf_Originvf_Velocity8.0 25.0 )

        
engfunc EngFunc_SetModel i_RocketR_MODEL );
        
engfunc EngFunc_SetSize  i_RocketFloat:{ 0.00.00.0 }, Float:{ 0.00.00.0 } );
        
engfunc EngFunc_SetOrigini_Rocketvf_Origin );

        
set_pev i_Rocketpev_velocityvf_Velocity );
        
        
FX_BeamFollow i_Rocketg_iEffectTRAIL ] , 25725500200 );    
        
        
set_pev(i_Rocketpev_nextthinkget_gametime( ) + 0.1)
    }
}

public 
CBaseWeapon__PostFrame__PrepEntity 
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
is_user_connectedpId ) && !HoldCBaseWeaponpId ) && !g_iMaxPlayers )
    {
        return 
HAM_HANDLED;
    }
    
    new 
fInReload get_pdata_intpEntity54OFFSET_LINUX_WEAPONS );
    new 
Float:flNextAttack get_pdata_floatpIdm_flNextAttackOFFSET_LINUX_WEAPONS );
    new 
iClip  get_pdata_intpEntitym_iClipOFFSET_LINUX_WEAPONS );
    new 
iAmmoType 376 get_pdata_intpEntity49OFFSET_LINUX_WEAPONS );
    new 
iBpAmmo  get_pdata_intpIdiAmmoTypeOFFSET_LINUX );
    
    if ( 
fInReload && flNextAttack <= 1.4 )
    {
        new 
minCLIP__WEAPON  iClipiBpAmmo);
    
        
set_pdata_intpEntitym_iClipiClip jOFFSET_LINUX_WEAPONS );
        
set_pdata_intpIdiAmmoTypeiBpAmmo-jOFFSET_LINUX );
        
set_pdata_intpEntity540OFFSET_LINUX_WEAPONS );

        
fInReload 0;
    }     
    
    return 
HAM_IGNORED;
}

public 
CBaseWeapon__Reload_Pre(pEntity
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_HANDLED;
    }

    static 
pId;

    
pId get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );

    if ( !
is_user_connectedpId ) || !HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iClipExtra;
    
iClipExtra CLIP__WEAPON ;
    
    
g_TmpClip[pId] = -1;
    
    new 
iAmmoType 376 get_pdata_intpEntity49OFFSET_LINUX_WEAPONS );
    new 
iBpAmmo get_pdata_intpIdiAmmoTypeOFFSET_LINUX );
    new 
iClip get_pdata_intpEntitym_iClipOFFSET_LINUX );
    
    if ( 
iBpAmmo <= || iClip >= iClipExtra )
    {
       return 
HAM_SUPERCEDE;
    }  
    
    
g_TmpClip[pId] = iClip;
    
    return 
HAM_HANDLED;
}

public 
CBaseWeapon__Reload_PostpEntity 
{
    if( !
IsValidPrivateDatapEntity ) )
    {
                return 
HAM_HANDLED;
    }

    static 
pId pId  get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );
    
    if ( !
HoldCBaseWeaponpId ) )
    {
        return 
HAM_IGNORED;
    }

    if (
g_TmpClippId ] == -1)
    {
        return 
HAM_IGNORED;
    }
    
    
set_pdata_floatpIdm_flNextAttackRELOAD_TIME OFFSET_LINUX);
    
    
UTIL_SenwWeaponAnim(pIdRELOAD);

    return 
HAM_HANDLED;
}

public 
CTouch_Rocket(pEntityid)
{
    if( !
pev_validpEntity ) )
    {
        return;
    }

    static 
Float:flOriginCoord_e ];
    
pevpEntitypev_originflOrigin );
    
    
set_pev(pEntitypev_movetypeMOVETYPE_NONE)
    
set_pev(pEntitypev_solidSOLID_NOT)    
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_EXPLOSION)
    
write_coord_f(  flOrigin[x])
    
write_coord_f(  flOrigin[y])
    
write_coord_fflOrigin[z] +50.0 )
    
write_short(g_iEffectEXPLODESPR ] )
    
write_byte50 )
    
write_byte30 )
    
write_byte)
    
message_end()

    
message_begin(MSG_ALLSVC_TEMPENTITY
    
write_byte(TE_WORLDDECAL)
    
write_coord_f(flOrigin[x])
    
write_coord_fflOrigin[y])
    
write_coord_fflOrigin[z])
    
write_byte(g_iEffectDECALINDEX ] )
    
message_end()

    new 
pOwner pevpEntitypev_owner );
       
    static 
pevVictimFloat:flDistance,Float:fDamage;
                       
    
pevVictim  = -1;
       
    while( ( 
pevVictim engfuncEngFunc_FindEntityInSpherepevVictimflOriginROCKET__RADIUS) ) != )
    {
            if( !
is_user_alivepevVictim ) )
                    continue;

            
//if( !zp_get_user_zombie( pevVictim ) )
            //    continue;

            
flDistance entity_rangepEntitypevVictim );

            
fDamage UTIL_FloatRadiusROCKET__DAMAGEROCKET__RADIUS flDistance );


            if( 
fDamage 0.0 )
            {
                    
ExecuteHamBHam_TakeDamagepevVictimpEntitypOwnerfDamageDMG_BULLET DMG_ALWAYSGIB);

            }

            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("ScreenFade"), {0,0,0}, pevVictim )
            
write_short(1<<10)
            
write_short(1<<10)
            
write_short(0x0000)
            
write_byte(200)
            
write_byte(0)
            
write_byte(0)
            
write_byte(75)
            
message_end()
    }
       
    
engfuncEngFunc_RemoveEntitypEntity );
}

Float:UTIL_FloatRadiusFloat:flMaxAmountFloat:flRadiusFloat:flDistance )
{
        return 
floatsubflMaxAmountfloatmulfloatdivflMaxAmountflRadius ), flDistance ) );
}

public 
CThink_RocketiRocket )
{
    if(!
pev_validiRocket ))
    {
        return
    }    

    static 
Float:fOrigin[3]
    
peviRocket pev_originfOrigin)
        
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_SPRITE )
    
engfuncEngFunc_WriteCoordfOrigin[0] )
    
engfuncEngFunc_WriteCoordfOrigin[1] )
    
engfuncEngFunc_WriteCoordfOrigin[2] )
    
write_shortg_iEffectPUFFSPR ] ) 
    
write_byte
    
write_byte255 )
    
message_end( )
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byteTE_SPARKS 
    
engfuncEngFunc_WriteCoordfOrigin[0] )
    
engfuncEngFunc_WriteCoordfOrigin[1] )
    
engfuncEngFunc_WriteCoordfOrigin[2] )
    
message_end( )
        
    
set_peviRocket pev_nextthinkget_gametime( ) + 0.275 )
}

stock UTIL__DropWeapons(idbitsDropType)
{
    static 
weapons[32], numiweaponid
    num 

    get_user_weapons
(idweaponsnum)
    
    for (
0numi++)
    {
        
weaponid weapons[i]
        
        if ((
bitsDropType == DROP_PRIMARY && ((1<<weaponid) & WEAPONS_PRIMARY_BITSUM)) || (bitsDropType == DROP_SECONDARY && ((1<<weaponid) & WEAPONS_SECONDARY_BITSUM)))
        {
            static 
wname[32]
            
get_weaponname(weaponidwnamecharsmax(wname))
            
            
engclient_cmd(id"drop"wname)
            
cs_set_user_bpammo(idweaponid0)
        }
    }
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) { /* keep looping */ }
    return 
entity;
}

stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
    
set_pev(pPlayerpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player pPlayer)
    
write_byte(Sequence)
    
write_byte(pev(pPlayerpev_body))
    
message_end()
}

UTIL__WeaponListpPlayer, const szWeapon[ ], intint2int3int4int5int6int7int8 )
{
    
message_beginMSG_ONEget_user_msgid"WeaponList" ) , _pPlayer );
    
write_stringszWeapon );
    
write_byte( int );
    
write_byteint2);
    
write_byteint3 );
    
write_byteint4 );
    
write_byteint5 );
    
write_byteint6 );
    
write_byteint7 );
    
write_byteint8 );
    
message_end( );
}

stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
    if (!
pev_valid(ent)) return 0;
    
    static 
Float:originF[3]
    
pev(idpev_originoriginF)
    
set_pev(entpev_originoriginF)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    static 
save
    save 
pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentid)
    if (
pev(entpev_solid) != save) {
        
        
entity_set_int(entEV_INT_iuser1CUSTOM_BAZOOKA_ID)
    
        return 
ent ;
    
    }
    
    
engfunc(EngFunc_RemoveEntityent)
    
    return -
1;
}

FX_BeamFollow ( const i_Ent, const i_Trail, const i_Life, const i_Width, const i_Red, const i_Green, const i_Blue, const i_Brightness )
{
    
message_begin MSG_BROADCASTSVC_TEMPENTITY );
    
write_byte TE_BEAMFOLLOW );
    
write_short i_Ent );          // --| Enntity.
    
write_short i_Trail );        // --| Model.
    
write_byte i_Life );          // --| Life.
    
write_byte i_Width );         // --| Width.
    
write_byte i_Red );           // --| Red color.
    
write_byte i_Green );         // --| Green color.
    
write_byte i_Blue );          // --| Blue color.
    
write_byte i_Brightness );    // --| Brightness.
    
message_end ();
}

stock UTIL__SetCrosshairStatusPlayereState:mState )
{
    static 
afFlags
    afFlags 
0;
    
    if( 
mState == State_Hidden )
        
afFlags |= HIDE_CROSSHAIR;
    else
        
afFlags &= ~HIDE_CROSSHAIR;
    
    
message_beginMSG_ONEget_user_msgid"HideWeapon" ), _Player );
    
write_byteafFlags );
    
message_end( );
}


PrecacheSoundsFromModel(const szModelPath[])
{
    new 
iFile;
    
    if ((
iFile fopen(szModelPath"rt")))
    {
        new 
szSoundPath[64];
        
        new 
iNumSeqiSeqIndex;
        new 
iEventiNumEventsiEventIndex;
        
        
fseek(iFile164SEEK_SET);
        
fread(iFileiNumSeqBLOCK_INT);
        
fread(iFileiSeqIndexBLOCK_INT);
        
        for (new 
k0iNumSeqi++)
        {
            
fseek(iFileiSeqIndex 48 176 iSEEK_SET);
            
fread(iFileiNumEventsBLOCK_INT);
            
fread(iFileiEventIndexBLOCK_INT);
            
fseek(iFileiEventIndex 176 iSEEK_SET);

            for (
0iNumEventsk++)
            {
                
fseek(iFileiEventIndex 76 kSEEK_SET);
                
fread(iFileiEventBLOCK_INT);
                
fseek(iFile4SEEK_CUR);
                
                if (
iEvent != 5004)
                {
                    continue;
                }

                
fread_blocks(iFileszSoundPath64BLOCK_CHAR);
                
                if (
strlen(szSoundPath))
                {
                    
strtolower(szSoundPath);
                    
precache_sound(szSoundPath);
                }
            }
        }
    }
    
    
fclose(iFile);

Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#5
si funciona pero cuando tengo la deagle y disparo y recargo le baja el cargador no se puede arreglar eso o tiene que ser a si
Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#6
a mi me funciona bien..
Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#7
(10/01/2019, 02:10 AM)[R]ak escribió: a mi me funciona bien..

mmm que sera pongo el plugin del cargador de primero?
Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#8
no tengo los mdl; no puedo probar el plugin de bazooka

ni los sprite

ni el wav
Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#9
(10/01/2019, 02:17 AM)[R]ak escribió: no tengo los mdl; no puedo probar el plugin de bazooka

ni los sprite

ni el wav

bueno no importa esta bien a si hace su funcion bien muchas gracias
Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#10
listo; ya lo arregle
Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#11
(10/01/2019, 02:44 AM)[R]ak escribió: listo; ya lo arregle

pasamelo
Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder
#12
(10/01/2019, 09:14 AM)whOo escribió:
(10/01/2019, 02:44 AM)[R]ak escribió: listo; ya lo arregle

pasamelo

edite el codigo arriba...
Hi Milashkasiya CrabCrab

Soy un #Panda.. Soy solo un tipo que parece #común pero soy todo lo contrario; alguien #atípico en esta sociedad actual

[Imagen: xl0jvd-5.png]
Link
Responder
#13
(10/01/2019, 01:32 PM)[R]ak escribió:
(10/01/2019, 09:14 AM)whOo escribió:
(10/01/2019, 02:44 AM)[R]ak escribió: listo; ya lo arregle

pasamelo

edite el codigo arriba...

muchas gracias Gran sonrisa
Aprendiendo scripting Excitedeyes || Tratare ayudar en lo que pueda Trolleyes || PD: Soy pobre Cutecry
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)