HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include < amxmodx >
  2. #include < zombieplague >
  3.  
  4. #define PLUGIN_NAME "[ZP] Addon: Bonus Ammo Pack"
  5. #define PLUGIN_VERSION "0.2"
  6. #define PLUGIN_AUTHOR "Íåáîæèòåëü"
  7.  
  8. #define HUD_ZM_WIN 0, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
  9. #define HUD_ZM_FAIL 255, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
  10.  
  11. #define HUD_HM_WIN 0, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
  12. #define HUD_HM_FAIL 255, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
  13.  
  14. #define HUD_NO_ONE 255, 255, 255, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
  15.  
  16.  
  17. #define BONUS_ZM_WIN 10
  18. #define BONUS_ZM_FAIL 5
  19.  
  20.  
  21. #define BONUS_HM_WIN 10
  22. #define BONUS_HM_FAIL 5
  23.  
  24.  
  25. #define BONUS_NO_ONE 1
  26.  
  27. new g_maxplayers
  28.  
  29. public plugin_init() {
  30. register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
  31. register_dictionary ( "zp_bonus_ammopack.txt" )
  32.  
  33. g_maxplayers = get_maxplayers ( )
  34. }
  35.  
  36. public zp_round_ended ( Team ) {
  37.  
  38. if ( Team == WIN_ZOMBIES )
  39. {
  40. for ( new i = 1; i <= g_maxplayers ; i++ )
  41. {
  42. if ( ! is_user_connected ( i ) ) continue;
  43.  
  44. if ( zp_get_user_zombie ( i ) || zp_get_user_nemesis ( i ) )
  45. {
  46. set_hudmessage ( HUD_ZM_WIN )
  47. show_hudmessage(i, "%L", LANG_PLAYER, "WIN" , BONUS_ZM_WIN)
  48.  
  49. zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) + BONUS_ZM_WIN );
  50. }
  51. else
  52. {
  53. set_hudmessage( HUD_ZM_FAIL )
  54. show_hudmessage(i, "%L", LANG_PLAYER, "FAIL" , BONUS_ZM_FAIL)
  55.  
  56. zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) - BONUS_ZM_FAIL );
  57. }
  58. }
  59. }
  60. else if ( Team == WIN_HUMANS)
  61. {
  62. for ( new i = 1; i <= g_maxplayers ; i++ )
  63. {
  64. if ( ! is_user_connected ( i ) ) continue;
  65.  
  66. if ( zp_get_user_human ( i ) || zp_get_user_survivor ( i ) )
  67. {
  68. set_hudmessage( HUD_HM_WIN )
  69. show_hudmessage( i, "%L", LANG_PLAYER, "WIN" , BONUS_HM_WIN)
  70.  
  71. zp_set_user_ammo_packs( i, zp_get_user_ammo_packs( i ) + BONUS_HM_WIN );
  72. }
  73. else
  74. {
  75. set_hudmessage( HUD_HM_FAIL )
  76. show_hudmessage ( i , "%L", LANG_PLAYER, "FAIL" , BONUS_HM_FAIL)
  77.  
  78. zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) - BONUS_HM_FAIL ) ;
  79. }
  80. }
  81. }
  82. else
  83. {
  84. for ( new i = 1; i <= g_maxplayers ; i++ )
  85. {
  86. if ( ! is_user_connected ( i ) ) continue;
  87.  
  88. set_hudmessage ( HUD_NO_ONE )
  89. show_hudmessage ( i , "%L", LANG_PLAYER, "NO_ONE" , BONUS_NO_ONE )
  90.  
  91. zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) + BONUS_NO_ONE ) ;
  92. }
  93. }
  94. }
  95.  
  96. stock zp_get_user_human ( id )
  97. return ( ! zp_get_user_survivor ( id ) && ! zp_get_user_nemesis ( id ) && ! zp_get_user_zombie ( id ) )
  98.