Raised This Month: $18 Target: $400
 4% 

How to make extra item for 1 round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 04-30-2017 , 13:53   How to make extra item for 1 round
Reply With Quote #1

How to make it drop and don.t work in new round .make it for 1 round how??


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <engine>
#include <zmvipgold>

#define pDataKey_CustomAmmo 3

//Linux extra offsets
#define pData_Player                5
#define pData_Item                4

// CWeaponBox
#define pDataKey_WeaponBoxItems            34

//CBasePlayerItem
#define pDataKey_iOwner                41
#define pDataKey_iNext                42
#define pDataKey_iId                43

//CBasePlayerWeapon
#define pDataKey_flNextPrimaryAttack        46
#define pDataKey_flNextSecondaryAttack        47
#define pDataKey_flNextTimeWeaponIdle        48
#define pDataKey_iPrimaryAmmoType        49
#define pDataKey_iClip                51
#define pDataKey_iInReload            54
#define pDataKey_iSpecialReload            55
#define pDataKey_iState                74

//CBaseMonster
#define pDataKey_iLastHitGroup            75
#define pDataKey_flNextAttack            83

//CBasePlayer
#define m_flPainShock                           108
#define pDataKey_iPlayerItems            367
#define pDataKey_iActiveItem            373    
#define pDataKey_ibpAmmo            376
#define pDataKey_iPlayerWeaponAnim        492

#define PLUGIN "AirBurster"
#define VERSION "1.0"
#define AUTHOR "NONE"

#define WEAPON_KEY                82813
#define Is_CustomItem(%0)            (pev(%0,pev_impulse)==WEAPON_KEY)

//Weapon Settings
#define weapon_name    "weapon_m249"
#define weapon_new    "weapon_airburster"

#define model_v        "models/dm/v_airburster.mdl"
#define model_p        "models/dm/p_airburster.mdl"
#define model_w        "models/dm/w_airburster.mdl"
#define body_w        0

#define weapon_punchangle    0.0
#define weapon_aspeed        0.097

#define weapon_ammo        50
#define weapon_bpammo        100

#define sound_shot "weapons/airburster_shoot.wav"

new const sounds_dump[][]={
    
"weapons/airburster_shoot.wav"
};
/*new const precache_dump[][]={
    "sprites/dm_balrog7.txt",
    "sprites/dm/640hud2.spr",
    "sprites/dm/640hud76.spr"
};*/

new AllocString_V,AllocString_P;

//DM Register Item
new dm_item,g_steam;

#define DMG_ENTS    4
new const damage_entites[DMG_ENTS][]={"player","info_target","hostage_entity","func_breakable"}
new 
HamHook:tr_fwds[DMG_ENTS];
trace_register()for(new i=0;i<DMG_ENTS;i++)tr_fwds[i]=RegisterHam(Ham_TraceAttack,damage_entites[i],"HookHam_TakeTrace",0),DisableHamForward(tr_fwds[i])
stock trblock_enable(){for(new i=0;i<DMG_ENTS;i++)EnableHamForward(tr_fwds[i]);}
stock trblock_disable(){for(new i=0;i<DMG_ENTS;i++)DisableHamForward(tr_fwds[i]);}
public 
HookHam_TakeTrace(victim,inflictor,attackerFloat:damage){SetHamParamFloat(3,0.0);return HAM_SUPERCEDE;}

#define model_fire    "sprites/ef_aircyclone.spr"
#define classname_fire    "airthrower"

new frames;
//AMXX
public plugin_precache(){
    
engfunc(EngFunc_PrecacheModel,model_v);
    
engfunc(EngFunc_PrecacheModel,model_p);
    
engfunc(EngFunc_PrecacheModel,model_w);
    new 
a=engfunc(EngFunc_PrecacheModel,model_fire);
    
framesengfunc(EngFunc_ModelFrames,a);
    
g_steam=engfunc(EngFunc_PrecacheModel,"sprites/ef_airexplosion.spr");
    
AllocString_V engfunc(EngFunc_AllocStringmodel_v);
    
AllocString_P engfunc(EngFunc_AllocStringmodel_p);
    new 
i;
    for(
i=0;i<sizeof(sounds_dump);i++)engfunc(EngFunc_PrecacheSound,sounds_dump[i]);
    
//for(i=0;i<sizeof(precache_dump);i++)engfunc(EngFunc_PrecacheGeneric,precache_dump[i]);
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Item_Deploy,weapon_name,"HookHam_Weapon_Deploy",1);
    
RegisterHam(Ham_Item_AddToPlayer,weapon_name,"HookHam_Weapon_Add",1);
    
RegisterHam(Ham_Item_PostFrame,weapon_name,"HookHam_Weapon_Frame",0);
    
    
RegisterHam(Ham_Weapon_Reload,weapon_name,"HookHam_Weapon_Reload",0);
    
RegisterHam(Ham_Weapon_WeaponIdle,weapon_name,"HookHam_Weapon_Idle",0);
    
RegisterHam(Ham_Weapon_PrimaryAttack,weapon_name,"HookHam_Weapon_PrimaryAttack",0);
    
    
RegisterHam(Ham_Spawn,"weaponbox","HookHam_WeaponBox_Spawn",1);
    
register_forward(FM_SetModel,"HookFm_SetModel",0);
    
register_forward(FM_UpdateClientData,"HookFm_UpdateClientData",1);
    
    
register_think(classname_fire"Flame_Think");
    
register_touch(classname_fire,"*","Flame_Touch");
    
    
dm_item=za_register_extra_item("Air Bruster""Can air zombie"ZA_TEAM_HUMAN);
    
register_clcmd(weapon_new,"hook_item");
    
trace_register();
    
// Add your code here...
}
//Cl Cmds
public hook_item(id){
    
engclient_cmd(id,weapon_name);
    return 
PLUGIN_HANDLED;
}
public 
za_extra_item_selected(iditem){
    if(
item == dm_item) {
        
UTIL_DropWeapon(id,1);
        new 
weapon=make_weapon();if(weapon<=0) return;
        if(!
ExecuteHamB(Ham_AddPlayerItemidweapon)) {engfunc(EngFunc_RemoveEntityweapon);return;}
        
ExecuteHam(Ham_Item_AttachToPlayer,weaponid);
        new 
ammotype pDataKey_ibpAmmo +pDataKey_CustomAmmo;
        new 
ammo=get_pdata_int(idammotype,pData_Player);
        if(
ammoweapon_bpammo)set_pdata_int(idammotypeweapon_bpammo,pData_Player);
        
set_pdata_int(weapon,pDataKey_iClip,weapon_ammo,pData_Item);
        
emit_sound(idCHAN_ITEM"items/gunpickup2.wav"VOL_NORMATTN_NORM0PITCH_NORM);
        
engclient_cmd(id,weapon_name);
    }
}

//Ham hooks
public HookHam_Weapon_Deploy(ent){
    if(!
Is_CustomItem(ent))return HAM_IGNORED;
    new 
id=get_pdata_cbase(ent,pDataKey_iOwner,pData_Item);
    
set_pev_string(idpev_viewmodel2AllocString_V);
    
set_pev_string(idpev_weaponmodel2AllocString_P);
    
set_pdata_float(ent,pDataKey_flNextPrimaryAttack,1.2,pData_Item);
    
set_pdata_float(ent,pDataKey_flNextSecondaryAttack,1.2,pData_Item);
    
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,1.2,pData_Item);
    
Play_WeaponAnim(id,4);
    return 
HAM_IGNORED;
}
public 
HookHam_Weapon_Add(ent,id){
    new 
imp=pev(entpev_impulse);
    if(
imp==WEAPON_KEY)Weaponlist(id,true),set_pdata_int(idpDataKey_ibpAmmo +pDataKey_CustomAmmo,pev(ent,pev_iuser1),pData_Player);
    else if(
imp==0)Weaponlist(id,false);
    return 
HAM_IGNORED;
}
public 
HookHam_Weapon_Frame(ent){
    if(!
Is_CustomItem(ent)) return HAM_IGNORED;
    if(
get_pdata_int(entpDataKey_iInReload,pData_Item)){
        new 
id get_pdata_cbase(entpDataKey_iOwner,pData_Item);
        new 
clip,ammotype,ammo,j;
        
clip get_pdata_int(entpDataKey_iClip,pData_Item);
        
ammotype pDataKey_ibpAmmo +pDataKey_CustomAmmo;
        
ammo get_pdata_int(idammotype,pData_Player);
        
min(weapon_ammo clipammo);
        
set_pdata_int(entpDataKey_iClipclip+j,pData_Item);
        
set_pdata_int(idammotypeammo-j,pData_Player);
        
set_pdata_int(entpDataKey_iInReload,0,pData_Item);
    }
/*else if(get_pdata_int(ent,pDataKey_iClip)<=0){
        new id = get_pdata_cbase(ent, pDataKey_iOwner,pData_Item);
        if(get_pdata_int(id,pDataKey_ibpAmmo+pDataKey_CustomAmmo)>0&&!(pev(id,pev_button)&IN_ATTACK))
            ExecuteHamB(Ham_Weapon_Reload,ent);
    }*/
else if(get_pdata_int(ent,pDataKey_iState,pData_Item)>0){
        new 
id=get_pdata_cbase(entpDataKey_iOwner,pData_Item)
        if(!(
pevid,pev_button)&IN_ATTACK)|| get_pdata_int(entpDataKey_iClip,pData_Item)<=0){
            
set_pdata_int(ent,pDataKey_iState,0,pData_Item);
            
Play_WeaponAnim(id,2);
            
set_pdata_float(ent,pDataKey_flNextPrimaryAttack,0.8,pData_Item);
            
set_pdata_float(ent,pDataKey_flNextSecondaryAttack,0.8,pData_Item);
            
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,2.0,pData_Item);
        }
    }
    return 
HAM_IGNORED;
}
public 
HookHam_Weapon_Reload(ent){
    if(!
Is_CustomItem(ent)) return HAM_IGNORED;
    new 
clip get_pdata_int(entpDataKey_iClippData_Item);
    if(
clip >= weapon_ammo) return HAM_SUPERCEDE;
    
    new 
id get_pdata_cbase(entpDataKey_iOwnerpData_Item);
    if(
get_pdata_int(id,pDataKey_ibpAmmo+pDataKey_CustomAmmo,pData_Player)<=0)return HAM_SUPERCEDE;
    
    
set_pdata_int(entpDataKey_iClip0pData_Item);
    
ExecuteHam(Ham_Weapon_Reloadent);
    
set_pdata_int(entpDataKey_iClipclippData_Item);
    
set_pdata_int(entpDataKey_iInReload1pData_Item);
    new 
Float:time_reload=4.65;
    
set_pdata_float(ent,pDataKey_flNextPrimaryAttack,time_reload,pData_Item);
    
set_pdata_float(ent,pDataKey_flNextSecondaryAttack,time_reload,pData_Item);
    
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,time_reload,pData_Item);
    
set_pdata_float(id,pDataKey_flNextAttack,time_reload,pData_Player) ;
    
Play_WeaponAnim(id,3);
    return 
HAM_SUPERCEDE;
}
public 
HookHam_Weapon_Idle(ent){
    if(!
Is_CustomItem(ent))return HAM_IGNORED;
    if(
get_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,pData_Item)>0.0)return HAM_IGNORED;
    
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,1.7,pData_Item);
    
Play_WeaponAnim(get_pdata_cbase(ent,pDataKey_iOwner,pData_Item),0);
    return 
HAM_SUPERCEDE;
}
public 
HookHam_Weapon_PrimaryAttack(ent){
    if(!
Is_CustomItem(ent))return HAM_IGNORED;
    new 
ammo=get_pdata_int(ent,pDataKey_iClip,pData_Item);
    if(
ammo<=0){
        
ExecuteHam(Ham_Weapon_PlayEmptySoundent);
        
set_pdata_float(ent,pDataKey_flNextPrimaryAttack,weapon_aspeed,pData_Item);
        return 
HAM_SUPERCEDE;
    }
    
    new 
id=get_pdata_cbase(ent,pDataKey_iOwner,pData_Item)
    new 
Float:user_punchangle[3];pev(id,pev_punchangle,user_punchangle)
    new 
Float:oldidle=get_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,pData_Item);
    new 
fm_playbackevent=register_forward(FM_PlaybackEvent,"HookFm_PlayBackEvent",false)
    
trblock_enable()
    
    
ExecuteHam(Ham_Weapon_PrimaryAttack,ent);
    
    
trblock_disable()
    
unregister_forward(FM_PlaybackEvent,fm_playbackevent,false)
    
    new 
Float:user_newpunch[3];pev(id,pev_punchangle,user_newpunch)
    
user_newpunch[0]=user_punchangle[0]+(user_newpunch[0]-user_punchangle[0])*weapon_punchangle
    user_newpunch
[1]=user_punchangle[1]+(user_newpunch[1]-user_punchangle[1])*weapon_punchangle
    user_newpunch
[2]=user_punchangle[2]+(user_newpunch[2]-user_punchangle[2])*weapon_punchangle
    set_pev
(id,pev_punchangle,user_newpunch)
    
    
set_pdata_int(ent,pDataKey_iClip,ammo-1,pData_Item)
    
    if(
pev(id,pev_weaponanim)!=1||get_pdata_int(ent,pDataKey_iState,pData_Item)!=1){
        
set_pdata_int(ent,pDataKey_iState,1,pData_Item)
        
Play_WeaponAnim(id,1);
        
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,2.1,pData_Item);
    }else if(
oldidle<=0.0){
        
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,2.1,pData_Item);
        
Play_WeaponAnim(id,1);
    }else 
set_pdata_float(ent,pDataKey_flNextTimeWeaponIdle,oldidle,pData_Item);
    
    
emit_sound(idCHAN_WEAPON,sound_shot,VOL_NORMATTN_NORM0PITCH_NORM);
    
    
set_pdata_float(ent,pDataKey_flNextPrimaryAttack,weapon_aspeed,pData_Item)
    
    
    
//Create grnaede...
    
new Float:Origin[3];pev(id,pev_origin,Origin);
    new 
Float:vOfs[3];pev(id,pev_view_ofs,vOfs);
    
Origin[0]+=vOfs[0];
    
Origin[1]+=vOfs[1];
    
Origin[2]+=vOfs[2];
    
    new 
Float:vAngle[3];pev(id,pev_v_angle,vAngle);
    new 
Float:Vec[3];velocity_by_aim(id,1,Vec);
    
vAngle[0]=-vAngle[0];
    
    new 
Float:FireOrigin[3]
    
FireOrigin[0]=Vec[0]*25.0+Origin[0];
    
FireOrigin[1]=Vec[1]*25.0+Origin[1];
    
FireOrigin[2]=Vec[2]*25.0+Origin[2];
    
Vec[0]*=500.0;
    
Vec[1]*=500.0;
    
Vec[2]*=500.0;
        
    new 
tr=create_tr2();
    
engfunc(EngFunc_TraceLine,Origin,FireOrigin,IGNORE_MONSTERS,id,tr);
    
get_tr2(trTR_vecEndPosFireOrigin);
    
free_tr2(tr);    
        
    static 
info_target;
    if(!
info_target)info_targetengfunc(EngFunc_AllocString"info_target")
    
    new 
fire=engfunc(EngFunc_CreateNamedEntity,info_target)
    
set_pev(firepev_classnameclassname_fire);
    
engfunc(EngFunc_SetModelfiremodel_fire);
    
engfunc(EngFunc_SetSize ,fire,Float:{ 0.00.00.0 },Float:{ 0.00.00.0 })
    
engfunc(EngFunc_SetOriginfireOrigin);
    
set_pev(firepev_solidSOLID_TRIGGER);
    
set_pev(firepev_movetypeMOVETYPE_FLY);
    
set_pev(firepev_velocityVec);
    
set_pev(firepev_ownerid);
    
fm_set_rendering(fire,kRenderFxNone,255,255,255,kRenderTransAdd,255)
    
set_pev(fire,pev_scale ,0.01)
    
set_pev (fire,pev_nextthink,get_gametime()+0.06);
    return 
HAM_SUPERCEDE
}
public 
HookHam_WeaponBox_Spawn(ent)state SetModelEnabled;
//Fakemeta
public HookFm_SetModel(const ent,const str[]) <SetModelEnabled>{
    
state SetModelDisabled
    if(!
ent||!pev_valid(ent))return FMRES_HANDLED;
    static 
iclassname[32], itempev(entpev_classnameclassname31);
    if(!
equal(classname"weaponbox")) return FMRES_IGNORED;
    for(
06i++) {
        
item get_pdata_cbase(entpDataKey_WeaponBoxItems ipData_Item);
        if(
item && Is_CustomItem(item)) {
            
engfunc(EngFunc_SetModelentmodel_w);
            
set_pev(ent,pev_body,body_w);
            static 
owner;owner=pev(ent,pev_owner);
            if(
1<=owner<=32)
                
set_pev(item,pev_iuser1,get_pdata_int(ownerpDataKey_ibpAmmo +pDataKey_CustomAmmo,pData_Player)),
                
set_pdata_int(ownerpDataKey_ibpAmmo +pDataKey_CustomAmmo,0,pData_Player);
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}
public 
HookFm_SetModel() <SetModelDisabled> { return FMRES_IGNORED;}
public 
HookFm_SetModel() <> { return FMRES_IGNORED;}
public 
HookFm_PlayBackEvent()return FMRES_SUPERCEDE;
public 
HookFm_UpdateClientData(const id,const SendWeapons,const CD_Handle){
    static 
item;item=get_pdata_cbase(idpDataKey_iActiveItem,pData_Player);
    if(
item<=0||!Is_CustomItem(item))return FMRES_IGNORED;
    
set_cd(CD_HandleCD_flNextAttack,99999.0);
    return 
FMRES_HANDLED;
}
//Stocks
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16) {
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);

    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));

    return 
1;
}
stock make_weapon(){
    new 
ent
    static 
g_AllocString_E;
    if(
g_AllocString_E||(g_AllocString_E=engfunc(EngFunc_AllocString,weapon_name)))
        
ent engfunc(EngFunc_CreateNamedEntityg_AllocString_E);
    else return -
1;
    if(
ent <= 0) return -1;
    
set_pev(entpev_spawnflagsSF_NORESPAWN);
    
set_pev(entpev_impulseWEAPON_KEY);
    
ExecuteHam(Ham_Spawnent);
    
set_pdata_int(ent,pDataKey_iPrimaryAmmoType,15,pData_Item);
    return 
ent;
}
stock Play_WeaponAnim(const id,const anim){
    
set_pev(idpev_weaponanim,anim);
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM_id);
    
write_byte(anim);
    
write_byte(0);
    
message_end();
}
//3,    200,-1, -1, 0, 4, 20, 0,    // weapon_m249
stock Weaponlist(const id,const bool:set) {
    static 
Msg_WeaponList;
    if(!
Msg_WeaponList&&!(Msg_WeaponList=get_user_msgid("WeaponList")))return;
    
message_begin(MSG_ONEMsg_WeaponList, {0,0,0}, id);
    if(
set==true){
        
write_string(weapon_new);
        
write_byte(pDataKey_CustomAmmo);
        
write_byte(weapon_bpammo);
    }else{
        
write_string(weapon_name);
        
write_byte(3);
        
write_byte(200);
    }
    
write_byte(-1);
    
write_byte(-1);
    
write_byte(0);
    
write_byte(4);
    
write_byte(20);
    
message_end();
}

//Visit to AGHL.ru
stock UTIL_DropWeapon(const id,const slot){
    static 
iEntityiEntity get_pdata_cbase(id, (pDataKey_iPlayerItems slot), pData_Player);
    if(
iEntity 0) {
        static 
iNext,szWeaponName[32];
        do{
            
iNext get_pdata_cbase(iEntitypDataKey_iNext4);
            if(
get_weaponname(get_pdata_int(iEntitypDataKey_iId4), szWeaponName31))
                
engclient_cmd(id"drop"szWeaponName);
        } while(( 
iEntity iNext) > 0);
    }
}
//Fire
public Flame_Think(ent){
    new 
owner=pev(ent,pev_owner);
    if(!
is_user_connected(owner)){
        
engfunc(EngFunc_RemoveEntity,ent);
        return;
    }
    new 
Float:fFrame;pev(ent,pev_frame,fFrame);
    new 
Float:fOrigin[3];pev(ent,pev_origin,fOrigin);
    if(
pev(ent,pev_waterlevel)>0||fFrame>=(frames-1.0)){
        
/*
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0);
        write_byte(TE_EXPLOSION);
        engfunc(EngFunc_WriteCoord, fOrigin[0])
        engfunc(EngFunc_WriteCoord, fOrigin[1])
        engfunc(EngFunc_WriteCoord, fOrigin[2])
        write_short(g_steam); // sprite
        write_byte(random_num(1,6)); // scale in 0.1
        write_byte(random_num(10,30)); // framerate
        write_byte(TE_EXPLFLAG_NODLIGHTS|TE_EXPLFLAG_NOSOUND|TE_EXPLFLAG_NOPARTICLES); // flags
        message_end() ;
        */
        
engfunc(EngFunc_RemoveEntityent);
        return;
    }
    new 
Float:fScale;pev(ent,pev_scale,fScale);
    
    static 
mp;if(!mp)mp=get_maxplayers();
    new 
target;
    while((
target engfunc(EngFunc_FindEntityInSpheretargetfOrigin,35.0))> 0){
        if(
target==owner||target==ent)continue
        if(
pev(target,pev_takedamage)==DAMAGE_NO)continue
        new 
solid=pev(target,pev_solid);if(solid==SOLID_NOT||solid==SOLID_TRIGGER)continue
        new 
Float:Health;pev(target,pev_health,Health);if(Health<=0.0)continue
        if(
target<=mp){
            if(!
is_user_connected(target)||!zp_get_user_zombie(target))continue;
            
            
//new Float:user_pain=get_pdata_float(target,m_flPainShock,5);
            
            //set_pdata_int(target,pDataKey_iLastHitGroup,HIT_GENERIC,pData_Player);
            
            
new Float:user_velocity[3];
            
pev(target,pev_velocity,user_velocity);
            
            
ExecuteHamB(Ham_TakeDamagetargetentowner,5.0DMG_BULLET);
            
            
//set_pdata_float(target, m_flPainShock,user_pain,5);
            
if(is_user_alive(target)){
                new 
Float:vlen=floatsqroot(user_velocity[0]*user_velocity[0]+user_velocity[1]*user_velocity[1]);
                
user_velocity[0]=user_velocity[0]/vlen*floatmax(-60.0,vlen-16.0);
                
user_velocity[1]=user_velocity[1]/vlen*floatmax(-60.0,vlen-16.0);
                
set_pev(target,pev_velocity,user_velocity);
            }
        }else 
ExecuteHamB(Ham_TakeDamagetargetentowner,5.0DMG_BULLET)
    }
    
set_pev(ent,pev_scale,fScale+0.075)
    
set_pev(ent,pev_frame,fFrame+1.0)
    
set_pev (ent,pev_nextthink,get_gametime()+0.035)
}
public 
Flame_Touch(ent,touch){
    new 
owner=pev(ent,pev_owner);
    if(!
is_user_connected(owner)){
        
engfunc(EngFunc_RemoveEntity,ent);
        return;
    }
    if(
touch>0&&pev_valid(touch)){
        static 
mp;if(!mp)mp=get_maxplayers();
        if(
touch<=mp){
            if(!
is_user_connected(touch)||!zp_get_user_zombie(touch))return;
            
            
//set_pdata_int(touch,pDataKey_iLastHitGroup,HIT_GENERIC,pData_Player);
            //new Float:user_pain=get_pdata_float(touch,m_flPainShock,5);
            
            
new Float:user_velocity[3];
            
pev(touch,pev_velocity,user_velocity);
            
            
ExecuteHamB(Ham_TakeDamagetouchentowner,75.0DMG_BULLET);
            
            
//set_pdata_float(touch, m_flPainShock,user_pain,5);
            
            
if(is_user_alive(touch)){
                new 
Float:vlen=floatsqroot(user_velocity[0]*user_velocity[0]+user_velocity[1]*user_velocity[1]);
                
user_velocity[0]=user_velocity[0]/vlen*floatmax(-16.0,vlen-16.0);
                
user_velocity[1]=user_velocity[1]/vlen*floatmax(-16.0,vlen-16.0);
                
set_pev(touch,pev_velocity,user_velocity);
            }
        }else 
ExecuteHamB(Ham_TakeDamagetouchent,owner,75.0DMG_BULLET);
    }

    new 
Float:fOrigin[3];pev(ent,pev_origin,fOrigin)
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYfOrigin0);
    
write_byte(TE_EXPLOSION);
    
engfunc(EngFunc_WriteCoordfOrigin[0])
    
engfunc(EngFunc_WriteCoordfOrigin[1])
    
engfunc(EngFunc_WriteCoordfOrigin[2])
    
write_short(g_steam); // sprite
    
write_byte(random_num(1,6)); // scale in 0.1
    
write_byte(random_num(10,30)); // framerate
    
write_byte(TE_EXPLFLAG_NODLIGHTS|TE_EXPLFLAG_NOSOUND|TE_EXPLFLAG_NOPARTICLES); // flags
    
message_end() ;
            
    
engfunc(EngFunc_RemoveEntityent)
    


Last edited by ahmedkhater012; 04-30-2017 at 22:22.
ahmedkhater012 is offline
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 04-30-2017 , 22:18   Re: Help in zm plugin
Reply With Quote #2

No one know how to make it . where are good coder?
ahmedkhater012 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:54.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode