Advertisement
Guest User

functionx

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.31 KB | None | 0 0
  1. public AWPFire(this, Float:flSpread, Float:flCycleTime, bool:fUseAutoAim)
  2. {
  3.     new id = get_pdata_cbase(this, m_pPlayer, OFFSET_LINUX_WEAPONS)
  4.    
  5.     if(get_pdata_int(id, m_iFOV) != 90)
  6.     {
  7.         set_pdata_int(id, m_iLastZoom, get_pdata_int(id, m_iFOV));
  8.         set_pdata_bool(id, m_bResumeZoom, true);
  9.        
  10.         set_pdata_int(id, m_iFOV, 90)
  11.         set_pev(id, pev_fov, 90)
  12.         set_pev(id, pev_viewmodel2, WEAPON_MODELS[0])
  13.     }
  14.     else
  15.     {
  16.         flCycleTime += 0.5;
  17.         flSpread += 0.03;
  18.     }
  19.     new iClip = get_pdata_int(this, m_iClip, OFFSET_LINUX_WEAPONS);
  20.    
  21.     if (iClip <= 0)
  22.     {
  23.         if(get_pdata_int(this, m_fFireOnEmpty, OFFSET_LINUX_WEAPONS))
  24.         {
  25.             ExecuteHam(Ham_Weapon_PlayEmptySound, this);
  26.             set_pdata_float(this, m_flNextPrimaryAttack, 0.2)
  27.         }
  28.         return;
  29.     }
  30.  
  31.     iClip--;
  32.     set_pdata_int(this, m_iClip, iClip, OFFSET_LINUX_WEAPONS);
  33.    
  34.     set_pev(id, pev_effects, (pev(id, pev_effects) | EF_MUZZLEFLASH));
  35.     OrpheuCall(OrpheuGetFunction("SetAnimation", "CBasePlayer"), id, PLAYER_ATTACK1)
  36.    
  37.     set_pdata_float(id, m_flEjectBrass, get_gametime() + 0.55);
  38.     set_pdata_int(id, m_iWeaponVolume, BIG_EXPLOSION_VOLUME);
  39.     set_pdata_int(id, m_iWeaponFlash, NORMAL_GUN_FLASH);
  40.    
  41.     UTIL_SendWeaponAnim(id, random_num(0, 1) ? ANIM_SHOOT1 : ANIM_SHOOT2)
  42.    
  43.     new Float:vecVAngle[3], Float:vecPunchangle[3], Float:vecTemp[3];
  44.     pev(id, pev_v_angle, vecVAngle)
  45.     pev(id, pev_punchangle, vecPunchangle)
  46.     xs_vec_add(vecVAngle, vecPunchangle, vecTemp);
  47.     engfunc(EngFunc_MakeVectors, vecTemp);
  48.    
  49.     new Float:vecSrc[3];
  50.     new Float:vecDir[3];
  51.    
  52.     GetGunPosition(id, vecSrc)
  53.    
  54.     new Float:vecForward[3];
  55.     global_get(glb_v_forward, vecForward);
  56.    
  57.     // 伤害和穿透和距离修正
  58.     //FireBullets3(id, vecSrc, vecForward, flSpread, 8192.0, WEAPON_PENETRATION + 1, BULLET_PLAYER_762MM, WEAPON_DAMAGE, WEAPON_DAMAGEDECAY, id, false, random(233)/*random_seed*/, vecDir);
  59.  
  60.     set_pdata_float(this, m_flNextPrimaryAttack, flCycleTime, OFFSET_LINUX_WEAPONS)
  61.     set_pdata_float(this, m_flNextSecondaryAttack, flCycleTime, OFFSET_LINUX_WEAPONS)
  62.     set_pdata_float(this, m_flTimeWeaponIdle, 2.0)
  63.    
  64.     static Float:vecVelocity[3]
  65.     pev(id, pev_velocity, vecVelocity)
  66.     vecVelocity[2] = 0.0
  67.    
  68.     // 后坐力
  69.     vecPunchangle[0] -= 12.0 //2.0
  70.     set_pev(id, pev_punchangle, vecPunchangle)
  71.    
  72.     engfunc(EngFunc_EmitSound, id, CHAN_WEAPON, WEAPON_SOUND[0], 0.8, ATTN_NORM, 0, PITCH_NORM)
  73.    
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement