HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Copyright © 2009, ConnorMcLeod
  2.  
  3. AutoReload on NewRound is free software;
  4. you can redistribute it and/or modify it under the terms of the
  5. GNU General Public License as published by the Free Software Foundation.
  6.  
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11.  
  12. You should have received a copy of the GNU General Public License
  13. along with AutoReload on NewRound; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17.  
  18. #include <amxmodx>
  19. #include <fakemeta>
  20. #include <hamsandwich>
  21.  
  22. #define PLUGIN "Reloaded Weapons On New Round"
  23. #define AUTHOR "ConnorMcLeod"
  24. #define VERSION "2.0.0"
  25.  
  26. #define m_pNext 42
  27. #define m_fInReload 54
  28.  
  29. #define m_flNextAttack 83
  30. #define m_rgpPlayerItems_Slot1 368
  31. #define m_rgpPlayerItems_Slot2 369
  32.  
  33. public plugin_init()
  34. {
  35. register_plugin(PLUGIN, VERSION, AUTHOR)
  36. RegisterHam(Ham_Spawn, "player", "Player_Spawn")
  37. }
  38.  
  39. public Player_Spawn( id )
  40. {
  41. if( !is_user_alive(id) )
  42. {
  43. return
  44. }
  45.  
  46. set_pdata_float(id, m_flNextAttack, -0.001, 5)
  47.  
  48. new iWeapon
  49. for(new i=m_rgpPlayerItems_Slot1; i<=m_rgpPlayerItems_Slot2; i++)
  50. {
  51. iWeapon = get_pdata_cbase(id, i, 5)
  52. while( pev_valid(iWeapon) )
  53. {
  54. set_pdata_int(iWeapon, m_fInReload, 1, 4)
  55. ExecuteHamB(Ham_Item_PostFrame, iWeapon)
  56. iWeapon = get_pdata_cbase(iWeapon, m_pNext, 4)
  57. }
  58. }
  59. }