Raised This Month: $ Target: $400
 0% 

[ZP]Extra item: Barrett M95 ver: 1.1


Post New Thread Reply   
 
Thread Tools Display Modes
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-12-2011 , 05:26   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #21

try it
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <fakemeta> 
#include <engine>
#include <fakemeta_util> 
#include <hamsandwich> 
#include <zombieplague> 
new bool:g_haswp[33
const 
m_pPlayer            41 
const m_iId                43 
const m_fKnown                44 
const m_flNextPrimaryAttack    46 
const m_flNextSecondaryAttack    47 
const m_flTimeWeaponIdle        48 
const m_iPrimaryAmmoType        49 
const m_iClip                51 
const m_fInReload            54 
const m_fInSpecialReload        55 
const m_fSilent            74 
// players offsets 
const m_flNextAttack        83 
const m_rgAmmo_player_Slot0    376 
stock 
const g_iDftMaxClip[CSW_P90+1] = { 
    -
1,  13, -110,  1,  7,    13030,  1,  30,  
        
2025303525,   12201030100,  
        
303020,  2,    73030, -1,  50
stock const Float:g_fDelay[CSW_P90+1] = { 
    
0.002.700.002.000.000.55,   0.003.153.300.004.50,  
         
2.703.503.352.453.30,   2.702.202.502.634.70,  
         
0.553.052.123.500.00,   2.203.002.450.003.40 

const 
SILENT_BS    = ((1<<CSW_USP)|(1<<CSW_M4A1)) 
stock const g_iReloadAnims[CSW_P90+1] = { 
    -
1,  5, -13, -1,  6,   -111, -114,  
        
4,  23,  1,  1,   1374,  1,  3,  
        
6111,  3, -1,    411, -1,  1
new 
v_model[64] = "models/v_m95.mdl" 
new p_model[64] = "models/p_m95.mdl" 
new w_model[64] = "models/w_m95.mdl" 
#define weapon_impulse 1212454554
new g_dmgg_speedg_clipg_ammog_speed_player
new g_itemid
public plugin_init() 

    
register_plugin("barrett - M95""1.1""Teo"
    
register_event("Curweapon""current_weapon""be""1=1"
 
    
RegisterHam(Ham_TakeDamage"player""fw_takedamage")  
    
register_forward(FM_SetModel"forward_setmodel"1
    
register_forward(FM_PlayerPreThink,"fw_ppt")
    
RegisterHam(Ham_Item_AddToPlayer"weapon_ak47""fw_item_addplayer")
    
RegisterHam(Ham_Item_PostFrame"weapon_awp""Item_PostFrame"
    
g_itemid zp_register_extra_item(" Barrett M95",25,ZP_TEAM_HUMAN)
    
g_dmg register_cvar("zp_m95_dmg","5")
    
g_speed register_cvar("zp_m95_speed","3")
    
g_clip register_cvar("zp_m95_clip","5")
    
g_ammo register_cvar("zp_m95_ammo","30")
    
g_speed_player register_cvar("zp_m95_player_speed","200")

public 
plugin_precache() 

    
precache_model(v_model
    
precache_model(p_model
    
precache_model(w_model

 
public 
current_weapon(id

    if(
g_haswp[id] && get_user_weapon(id) == CSW_AWP
    { 
        
set_pev(idpev_viewmodel2v_model
        
set_pev(idpev_weaponmodel2p_model
 new 
ent fm_find_ent_by_owner(-1."weapon_awp",id)
        if(!
ent
            return 
        new 
Float:Delay get_pdata_float(ent464) * get_pcvar_float(g_speed)
        
set_pdata_float(ent46Delay4
    }   

public 
fw_takedamage(idinflictorvictimFloat:damagedamagebits

    if(
g_haswp[id] && get_user_weapon(id) == CSW_AWP
    { 
        
SetHamParamFloat(4damage get_pcvar_float(g_dmg)) 
    } 

public 
Item_PostFrame(iEnt

    static 
id id get_pdata_cbase(iEntm_pPlayer4
    new 
plrClipplrAmmoplrWeapId 
    plrWeapId 
get_user_weapon(idplrClip plrAmmo
 
    if (
plrWeapId == CSW_AWP && g_haswp[id]) 
    { 
    static 
iId iId get_pdata_int(iEntm_iId4
    static 
iMaxClip iMaxClip get_pcvar_num(g_clip)
    static 
fInReload fInReload get_pdata_int(iEntm_fInReload4
    static 
Float:flNextAttack flNextAttack get_pdata_float(idm_flNextAttack5
    static 
iAmmoType iAmmoType m_rgAmmo_player_Slot0 get_pdata_int(iEntm_iPrimaryAmmoType4
    static 
iBpAmmo iBpAmmo get_pdata_int(idiAmmoType5
    static 
iClip iClip get_pdata_int(iEntm_iClip4
 
    if( 
fInReload && flNextAttack <= 0.0 
    { 
        new 
min(iMaxClip iClipiBpAmmo
        
set_pdata_int(iEntm_iClipiClip j4
        
set_pdata_int(idiAmmoTypeiBpAmmo-j5)         
        
set_pdata_int(iEntm_fInReload04
        
fInReload 
    

 
    static 
iButton iButton pev(idpev_button
    if(    (
iButton IN_ATTACK2 && get_pdata_float(iEntm_flNextSecondaryAttack4) <= 0.0
    ||    (
iButton IN_ATTACK && get_pdata_float(iEntm_flNextPrimaryAttack4) <= 0.0)    ) 
    { 
        return 
    } 
 
    if( 
iButton IN_RELOAD && !fInReload 
    { 
        if( 
iClip >= iMaxClip 
        { 
            
set_pev(idpev_buttoniButton & ~IN_RELOAD
            if( 
SILENT_BS & (1<<iId) && !get_pdata_int(iEntm_fSilent4) ) 
            { 
                
SendWeaponAnimidiId == CSW_USP 
            } 
            else 
            { 
                
SendWeaponAnim(id0
            } 
        } 
        else if( 
iClip == g_iDftMaxClip[iId] ) 
        { 
            if( 
iBpAmmo 
            { 
                
set_pdata_float(idm_flNextAttackg_fDelay[iId], 5
                if( 
SILENT_BS & (1<<iId) && get_pdata_int(iEntm_fSilent4) ) 
                { 
                    
SendWeaponAnimidiId == CSW_USP 
                } 
                else 
                { 
                    
SendWeaponAnim(idg_iReloadAnims[iId]) 
                } 
                
set_pdata_int(iEntm_fInReload14
                
set_pdata_float(iEntm_flTimeWeaponIdleg_fDelay[iId] + 0.54
            } 
        } 
    } 
 
    } 

SendWeaponAnim(idiAnim

    
set_pev(idpev_weaponanimiAnim
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM_id
    
write_byte(iAnim
    
write_byte(pev(id,pev_body)) 
    
message_end() 
}  
public 
zp_extra_item_selected(iditemid)
{
 if(
itemid == g_itemid)
 {
  
g_haswp[id] = true
  fm_give_item
(id,"weapon_awp")
  new 
ent fm_find_ent_by_owner(-1,"weapon_awp",id)
  if(!
ent)
   return
  
cs_set_user_bpammo(id,CSW_AWP,get_pcvar_num(g_ammo))
  
cs_set_weapon_ammo(entget_pcvar_num(g_clip))
 }
}
public 
forward_setmodel(entity, const model[])
{
 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 
Owner
 
 Owner 
pev(entitypev_owner)
 
 if(
equal(model"models/w_awp.mdl"))
 {
  static 
weapid
 
  weapid 
find_ent_by_owner(-1"weapon_awp"entity)
 
  if(!
is_valid_ent(weapid))
   return 
FMRES_IGNORED;
 
  if(
g_haswp[Owner])
  {
   
entity_set_int(weapidEV_INT_impulseweapon_impulse)
 
   
g_haswp[Owner] = false
 
   entity_set_model
(entityw_model)
 
   return 
FMRES_SUPERCEDE;
  }
 }
 
 return 
FMRES_IGNORED;
}
public 
fw_item_addplayer(entid)
{
 if(!
is_valid_ent(ent) || !is_user_connected(id))
  return 
HAM_IGNORED;
 
 if(
entity_get_int(entEV_INT_impulse) == weapon_impulse)
 {
  
g_haswp[id] = true
 
  entity_set_int
(entEV_INT_impulse0)
 
  return 
HAM_HANDLED;
 }
 
 return 
HAM_IGNORED;
}
 
 
public 
fw_ppt(id)
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return 
FMRES_IGNORED
    
if(g_haswp[id] && get_user_weapon(id) == CSW_AWP)
    {
        
set_pev(idpev_maxspeedget_pcvar_float(g_speed_player))
    }
    return 
FMRES_IGNORED

__________________

Hatsune Miku~

Last edited by tei1995; 06-12-2011 at 22:15.
tei1995 is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 06-12-2011 , 06:57   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #22

Quote:
Originally Posted by tei1995 View Post
try it
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <fakemeta> 
#include <engine>
#include <fakemeta_util> 
#include <hamsandwich> 
#include <zombieplague> 

new bool:g_haswp[33
const 
m_pPlayer            41 
const m_iId                43 
const m_fKnown                44 
const m_flNextPrimaryAttack    46 
const m_flNextSecondaryAttack    47 
const m_flTimeWeaponIdle        48 
const m_iPrimaryAmmoType        49 
const m_iClip                51 
const m_fInReload            54 
const m_fInSpecialReload        55 
const m_fSilent            74 

// players offsets 
const m_flNextAttack        83 
const m_rgAmmo_player_Slot0    376 
stock 
const g_iDftMaxClip[CSW_P90+1] = { 
    -
1,  13, -110,  1,  7,    13030,  1,  30,  
        
2025303525,   12201030100,  
        
303020,  2,    73030, -1,  50

stock const Float:g_fDelay[CSW_P90+1] = { 
    
0.002.700.002.000.000.55,   0.003.153.300.004.50,  
         
2.703.503.352.453.30,   2.702.202.502.634.70,  
         
0.553.052.123.500.00,   2.203.002.450.003.40 

const 
SILENT_BS    = ((1<<CSW_USP)|(1<<CSW_M4A1)) 
stock const g_iReloadAnims[CSW_P90+1] = { 
    -
1,  5, -13, -1,  6,   -111, -114,  
        
4,  23,  1,  1,   1374,  1,  3,  
        
6111,  3, -1,    411, -1,  1
new 
v_model[64] = "models/v_m95.mdl" 
new p_model[64] = "models/p_m95.mdl" 
new w_model[64] = "models/w_m95.mdl" 

#define weapon_impulse 1212454554

new g_dmgg_speedg_clipg_ammog_speed_player
new g_itemid

public plugin_init() 

    
register_plugin("barrett - M95""1.1""Teo"
    
register_event("Curweapon""current_weapon""be""1=1"
 
    
RegisterHam(Ham_TakeDamage"player""fw_takedamage"
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""fw_speed",1
    
register_forward(FM_SetModel"forward_setmodel"1
    
register_forward(FM_PlayerPreThink,"fw_ppt")
    
RegisterHam(Ham_Item_AddToPlayer"weapon_ak47""fw_item_addplayer")

    
RegisterHam(Ham_Item_PostFrame"weapon_awp""Item_PostFrame"

    
g_itemid zp_register_extra_item(" Barrett M95",25,ZP_TEAM_HUMAN)

    
g_dmg register_cvar("zp_m95_dmg","5")
    
g_speed register_cvar("zp_m95_speed","3")
    
g_clip register_cvar("zp_m95_clip","5")
    
g_ammo register_cvar("zp_m95_ammo","30")
    
g_speed_player register_cvar("zp_m95_player_speed","200")


public 
plugin_precache() 

    
precache_model(v_model
    
precache_model(p_model
    
precache_model(w_model

 
public 
current_weapon(id

    if(
g_haswp[id] && get_user_weapon(id) == CSW_AWP
    { 
        
set_pev(idpev_viewmodel2v_model
        
set_pev(idpev_weaponmodel2p_model
    } 

public 
fw_speed(ent

    new 
id pev(idpev_owner
    if(
g_haswp[id] && get_user_weapon(id) == CSW_AWP
    {     
        if(!
ent
            return 
        new 
Float:Delay get_pdata_float(ent464) * get_pcvar_float(g_speed)
        
set_pdata_float(ent46Delay4
    } 
    return  


public 
fw_takedamage(idinflictorvictimFloat:damagedamagebits

    if(
g_haswp[id] && get_user_weapon(id) == CSW_AWP
    { 
        
SetHamParamFloat(4damage get_pcvar_float(g_dmg)) 
    } 

public 
Item_PostFrame(iEnt

    static 
id id get_pdata_cbase(iEntm_pPlayer4
    new 
plrClipplrAmmoplrWeapId 
    plrWeapId 
get_user_weapon(idplrClip plrAmmo
     
    if (
plrWeapId == CSW_AWP && g_haswp[id]) 
    { 

    static 
iId iId get_pdata_int(iEntm_iId4
    static 
iMaxClip iMaxClip get_pcvar_num(g_clip)
    static 
fInReload fInReload get_pdata_int(iEntm_fInReload4
    static 
Float:flNextAttack flNextAttack get_pdata_float(idm_flNextAttack5

    static 
iAmmoType iAmmoType m_rgAmmo_player_Slot0 get_pdata_int(iEntm_iPrimaryAmmoType4
    static 
iBpAmmo iBpAmmo get_pdata_int(idiAmmoType5
    static 
iClip iClip get_pdata_int(iEntm_iClip4


    if( 
fInReload && flNextAttack <= 0.0 
    { 
        new 
min(iMaxClip iClipiBpAmmo
        
set_pdata_int(iEntm_iClipiClip j4
        
set_pdata_int(idiAmmoTypeiBpAmmo-j5)         
        
set_pdata_int(iEntm_fInReload04
        
fInReload 
    

     
    static 
iButton iButton pev(idpev_button
    if(    (
iButton IN_ATTACK2 && get_pdata_float(iEntm_flNextSecondaryAttack4) <= 0.0
    ||    (
iButton IN_ATTACK && get_pdata_float(iEntm_flNextPrimaryAttack4) <= 0.0)    ) 
    { 
        return 
    } 
     
    if( 
iButton IN_RELOAD && !fInReload 
    { 
        if( 
iClip >= iMaxClip 
        { 
            
set_pev(idpev_buttoniButton & ~IN_RELOAD
            if( 
SILENT_BS & (1<<iId) && !get_pdata_int(iEntm_fSilent4) ) 
            { 
                
SendWeaponAnimidiId == CSW_USP 
            } 
            else 
            { 
                
SendWeaponAnim(id0
            } 
        } 
        else if( 
iClip == g_iDftMaxClip[iId] ) 
        { 
            if( 
iBpAmmo 
            { 
                
set_pdata_float(idm_flNextAttackg_fDelay[iId], 5

                if( 
SILENT_BS & (1<<iId) && get_pdata_int(iEntm_fSilent4) ) 
                { 
                    
SendWeaponAnimidiId == CSW_USP 
                } 
                else 
                { 
                    
SendWeaponAnim(idg_iReloadAnims[iId]) 
                } 
                
set_pdata_int(iEntm_fInReload14

                
set_pdata_float(iEntm_flTimeWeaponIdleg_fDelay[iId] + 0.54
            } 
        } 
    } 
     
    } 

SendWeaponAnim(idiAnim

    
set_pev(idpev_weaponanimiAnim

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM_id
    
write_byte(iAnim
    
write_byte(pev(id,pev_body)) 
    
message_end() 
}  
public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_itemid)
    {
        
g_haswp[id] = true
        fm_give_item
(id,"weapon_awp")
        new 
ent fm_find_ent_by_owner(-1,"weapon_awp",id)
        if(!
ent)
            return
        
cs_set_user_bpammo(id,CSW_AWP,get_pcvar_num(g_ammo))
        
cs_set_weapon_ammo(entget_pcvar_num(g_clip))
    }
}
public 
forward_setmodel(entity, const model[])
{
    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 
Owner
    
    Owner 
pev(entitypev_owner)
    
    if(
equal(model"models/w_ak47.mdl"))
    {
        static 
weapid
        
        weapid 
find_ent_by_owner(-1"weapon_m249"entity)
    
        if(!
is_valid_ent(weapid))
            return 
FMRES_IGNORED;
    
        if(
g_haswp[Owner])
        {
            
entity_set_int(weapidEV_INT_impulseweapon_impulse)
            
            
g_haswp[Owner] = false
            
            entity_set_model
(entityw_model)
            
            return 
FMRES_SUPERCEDE;
        }
    }
    
    return 
FMRES_IGNORED;
}
public 
fw_item_addplayer(entid)
{
    if(!
is_valid_ent(ent) || !is_user_connected(id))
        return 
HAM_IGNORED;
    
    if(
entity_get_int(entEV_INT_impulse) == weapon_impulse)
    {
        
g_haswp[id] = true
        
        entity_set_int
(entEV_INT_impulse0)
        
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}
public 
fw_ppt(id)
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return 
FMRES_IGNORED
    
if(g_haswp[id] && get_user_weapon(id) == CSW_AWP)
    {
        
set_pev(idpev_maxspeedget_pcvar_num(g_speed_player))
    }
    return 
FMRES_IGNORED

correction. get_pcvar_float not num.
__________________
jc980 is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-12-2011 , 08:34   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #23

I am sorry, now you get it
__________________

Hatsune Miku~
tei1995 is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 06-12-2011 , 08:40   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #24

Quote:
Originally Posted by georgik57 View Post
why does everybody like making overpowering weapons?
it unbalances the gameplay
i still get infected. this weapon maybe overpowering but you have less speed. unless they camp in areas in ZM maps. (unless youre not a person playing in LAN with default maps and some zm maps that doesnt have camping spots, and he is run and gun player)
__________________

Last edited by jc980; 06-12-2011 at 08:52.
jc980 is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-12-2011 , 08:48   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #25

and it have less ammo
__________________

Hatsune Miku~
tei1995 is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 06-12-2011 , 08:52   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #26

Quote:
Originally Posted by tei1995 View Post
and it have less ammo
@tei1995

oh yeah, the model.

[ZP] CSO Transformation Pack 2011

36. CSO Barrett M95 - Download
__________________
jc980 is offline
albert123
Veteran Member
Join Date: Mar 2009
Location: VietNam, Hai Phong
Old 06-14-2011 , 13:50   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #27

@tei: Add recoil for this weapon. ( Should set high )
__________________
albert123 is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-14-2011 , 22:25   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #28

Quote:
Originally Posted by albert123 View Post
@tei: Add recoil for this weapon. ( Should set high )
will update...
__________________

Hatsune Miku~
tei1995 is offline
Lam Kundoo
Junior Member
Join Date: Nov 2012
Location: Camau,Vietnam
Old 11-09-2012 , 10:16   Re: [ZP]Extra item: Barrett M95 ver: 1.1
Reply With Quote #29

It use AWP Skin?
__________________


NST-Wpn mod: Coming soon
Lam Kundoo is offline
Send a message via Yahoo to Lam Kundoo
Reply



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 07:01.


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