need help make power sniper glock, like this from ozdm: http://www.youtube.com/watch?v=SUZ-txxBc6g
Код: #include <amxmodx> #include <fakemeta> #include <hamsandwich>
const m_pPlayer = 28 const m_flNextSecondaryAttack = 36
new zoom[33] new alive[33] new glock[33]
public plugin_init() { RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_9mmhandgun", "PrimaryAttack", 1) RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_9mmhandgun", "SecondaryAttack") RegisterHam(Ham_Item_Deploy, "weapon_9mmhandgun", "item_deploy", 1) RegisterHam(Ham_Item_Holster, "weapon_9mmhandgun", "item_holster", 1) RegisterHam(Ham_Weapon_Reload, "weapon_9mmhandgun", "weapon_reload")
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1) RegisterHam(Ham_Killed, "player", "Player_Killed", 1)
register_forward(FM_CmdStart, "CmdStart") }
public PrimaryAttack(const entity) { set_pdata_float(entity, m_flNextSecondaryAttack, 9999.0, 4) }
public SecondaryAttack(const entity) { return HAM_SUPERCEDE
}
public Player_Spawn(id) { alive[id] = is_user_alive(id) }
public Player_Killed(id) { alive[id] = is_user_alive(id) }
public CmdStart(id, uc_handle, seed) { if(alive[id] && glock[id] && get_uc(uc_handle, UC_Buttons) & IN_ATTACK2 && !(pev(id, pev_oldbuttons) & IN_ATTACK2)) {
switch(zoom[id]) { case 0: { zoom[id] = 1 set_pev(id, pev_fov, 45.0) } case 1: { zoom[id] = 0 set_pev(id, pev_fov, 90.0) } }
emit_sound(id, CHAN_ITEM, "weapons/xbow_reload1.wav", 0.20, 2.40, 0, 100)
} }
public item_holster(const gloc) { new id = get_pdata_cbase(gloc, m_pPlayer, 4)
set_pev(id, pev_fov, 90.0)
glock[ id ] = false }
public item_deploy(const gloc) { set_pdata_float(gloc, m_flNextSecondaryAttack, 9999.0, 4)
new id = get_pdata_cbase(gloc, m_pPlayer, 4)
glock[ id ] = true }
public weapon_reload(const gloc) { new id = get_pdata_cbase(gloc, m_pPlayer, 4)
set_pev(id, pev_fov, 90.0)
glock[ id ] = true }
|