hlmod.hu
https://hlmod.hu/

Örök Lőszer
https://hlmod.hu/viewtopic.php?f=24&t=19663
Oldal: 1 / 1

Szerző:  PiStA99 [ 2015.02.26. 16:38 ]
Hozzászólás témája:  Örök Lőszer

Hali,valaki le irja az örök lőszer plugint

Szerző:  HuBaBuBa [ 2015.02.26. 18:30 ]
Hozzászólás témája:  Re: Örök Lőszer

Végtelen tár:
SMA Forráskód: [ Mindet kijelol ]
  1. /* Formatright © 2009, ConnorMcLeod
  2.  
  3. Infinite BpAmmo 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 Infinite BpAmmo; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17.  
  18. // #define UNLIMITED_NADES
  19.  
  20. #include <amxmodx>
  21. #include <fakemeta>
  22.  
  23. #define VERSION "0.0.1"
  24.  
  25. enum
  26. {
  27. AmmoX_AmmoID = 1,
  28. AmmoX_Ammount
  29. }
  30.  
  31. enum
  32. {
  33. ammo_none,
  34. ammo_338magnum = 1, // 30
  35. ammo_762nato, // 90
  36. ammo_556natobox, // 200
  37. ammo_556nato, // 90
  38. ammo_buckshot, // 32
  39. ammo_45acp, // 100
  40. ammo_57mm, // 100
  41. ammo_50ae, // 35
  42. ammo_357sig, // 52
  43. ammo_9mm, // 120
  44. ammo_flashbang, // 2
  45. ammo_hegrenade, // 1
  46. ammo_smokegrenade, // 1
  47. ammo_c4 // 1
  48. }
  49.  
  50. new const g_iMaxBpAmmo[] = {
  51. 0,
  52. 30,
  53. 90,
  54. 200,
  55. 90,
  56. 32,
  57. 100,
  58. 100,
  59. 35,
  60. 52,
  61. 120,
  62. 2,
  63. 1,
  64. 1,
  65. 1
  66. }
  67.  
  68. #define XO_PLAYER 5
  69. #define m_rgpPlayerItems_0 376
  70.  
  71. public plugin_init()
  72. {
  73. register_plugin("Infinite BpAmmo", VERSION, "ConnorMcLeod")
  74. register_message(get_user_msgid("AmmoX"), "Message_AmmoX")
  75. }
  76.  
  77. public Message_AmmoX(iMsgId, iMsgDest, id)
  78. {
  79. new iAmmoID = get_msg_arg_int(AmmoX_AmmoID)
  80.  
  81. if( is_user_alive(id) && iAmmoID )
  82. {
  83. new iMaxBpAmmo = g_iMaxBpAmmo[iAmmoID]
  84. if( get_msg_arg_int(AmmoX_Ammount) < iMaxBpAmmo )
  85. {
  86. #if defined UNLIMITED_NADES
  87. if( iAmmoID < ammo_c4 )
  88. #else
  89. if( iAmmoID <= ammo_9mm )
  90. #endif
  91. {
  92. set_msg_arg_int(AmmoX_Ammount, ARG_BYTE, iMaxBpAmmo)
  93. set_pdata_int(id, m_rgpPlayerItems_0 + iAmmoID, iMaxBpAmmo, XO_PLAYER)
  94. }
  95. }
  96. }
  97. }
  98.  


Végtelen lőszer:
SMA Forráskód: [ Mindet kijelol ]
  1. /* Formatright © 2009, ConnorMcLeod
  2.  
  3. Infinite Ammo 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 Infinite BpAmmo; 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 VERSION "0.0.1"
  23.  
  24. enum
  25. {
  26. CurWeapon_IsActive = 1, // byte
  27. CurWeapon_WeaponID, // byte
  28. CurWeapon_ClipAmmo // byte
  29. }
  30.  
  31. #define XO_WEAPON 4
  32. #define m_iClip 51
  33. #define m_iClientClip 52
  34.  
  35. #define XO_PLAYER 5
  36. #define m_pActiveItem 373
  37.  
  38. new const g_iMaxClip[CSW_P90+1] = {
  39. -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30,
  40. 20, 25, 30, 35, 25, 12, 20, 10, 30, 100,
  41. 8 , 30, 30, 20, 2, 7, 30, 30, -1, 50
  42. }
  43.  
  44. public plugin_init()
  45. {
  46. register_plugin("Infinite Ammo", VERSION, "ConnorMcLeod")
  47.  
  48. register_message(get_user_msgid("CurWeapon"), "Message_CurWeapon")
  49. }
  50.  
  51. public Message_CurWeapon(iMsgId, iMsgDest, id)
  52. {
  53. if( get_msg_arg_int(CurWeapon_IsActive) )
  54. {
  55. new iMaxClip = g_iMaxClip[ get_msg_arg_int( CurWeapon_WeaponID ) ]
  56. if( get_msg_arg_int(CurWeapon_ClipAmmo) < iMaxClip )
  57. {
  58. new iWeapon = get_pdata_cbase(id, m_pActiveItem, XO_PLAYER)
  59. if( iWeapon > 0 )
  60. {
  61. set_pdata_int(iWeapon, m_iClip, iMaxClip, XO_WEAPON)
  62. set_pdata_int(iWeapon, m_iClientClip, iMaxClip, XO_WEAPON)
  63.  
  64. set_msg_arg_int(CurWeapon_ClipAmmo, ARG_BYTE, iMaxClip)
  65. }
  66. }
  67. }
  68. }
  69.  

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/