Advertisement
CheezPuff

[Reapi] Switch weapons after throwing grenades

Mar 17th, 2020
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.72 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <hamsandwich>
  5. #include <reapi>
  6.  
  7. #define PLUGIN "Switch weapons after throwing grenades"
  8. #define VERSION "1.0"
  9. #define AUTHOR "author"
  10.  
  11. public plugin_init() {
  12.     register_plugin(PLUGIN, VERSION, AUTHOR)
  13.    
  14.     RegisterHam(Ham_Weapon_WeaponIdle, "weapon_hegrenade", "Weapon_WeaponIdle_Pre", false);
  15. }
  16.  
  17. public Weapon_WeaponIdle_Pre(const item)
  18. {
  19.     if (Float:get_member(item, m_Weapon_flTimeWeaponIdle) > 0.0
  20.     || Float:get_member(item, m_flStartThrow) > 0.0
  21.     || Float:get_member(item, m_flReleaseThrow) < 0.0)
  22.     {
  23.         return HAM_IGNORED;
  24.     }
  25.    
  26.     set_member(item, m_flStartThrow, 0.0);
  27.     ExecuteHamB(Ham_Weapon_RetireWeapon, item);
  28.     return HAM_SUPERCEDE;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement