HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*================================================================================
  2. =
  3. = Plugin: Time Present's
  4. = Version: 0.1
  5. = Version mod: Zombie Plague
  6. =
  7. =
  8. = Description:
  9. = - This is plugin add in game presents.
  10. = Presents are given every 3 min, 5 min, 10 min.
  11. =
  12. = Defaults:
  13. = 3 min - 3 Ammo Packs
  14. = 5 min - 5 Ammo Packs
  15. = 10 min - 10 Ammo Packs
  16. =
  17. =
  18. =================================================================================*/
  19.  
  20. #include <amxmodx>
  21. #include <zombieplague>
  22.  
  23. /*================================================================================
  24.  [Macros]
  25. =================================================================================*/
  26.  
  27. #define SMALL 3
  28. #define AVERAGE 5
  29. #define LARGE 10
  30.  
  31. /*================================================================================
  32.  [Plugin Init]
  33. =================================================================================*/
  34.  
  35. public plugin_init()
  36. {
  37. register_plugin("Time Presents", "0.1", "WPMG Team")
  38. }
  39.  
  40. /*================================================================================
  41.  [Set Tasks]
  42. =================================================================================*/
  43.  
  44. public client_putinserver(id)
  45. {
  46. set_task(180.0, "small_present", id)
  47. set_task(300.0, "average_present", id)
  48. set_task(600.0, "large_present", id)
  49. }
  50.  
  51. /*================================================================================
  52.  [Remove Task]
  53. =================================================================================*/
  54.  
  55. public client_disconnect(id)
  56. {
  57. if(task_exists(id))
  58. remove_task(id)
  59. }
  60.  
  61. /*================================================================================
  62.  [Give Presents]
  63. =================================================================================*/
  64.  
  65. public small_present(id)
  66. {
  67. zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + SMALL)
  68. client_printcolor(id, "^4[SzerotolPenz] ^1Kaptal ^4%d Loszercsomagot^1, mert jaccotal ezen a szerveren^4 3 percet.", SMALL)
  69. }
  70.  
  71. public average_present(id)
  72. {
  73. zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + AVERAGE)
  74. client_printcolor(id, "^4[SzerotolPenz] ^1Kaptal ^4%d Loszercsomagot^1, mert jaccotal ezen a szerveren^4 5 percet.", AVERAGE)
  75. }
  76.  
  77. public large_present(id)
  78. {
  79. zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + LARGE)
  80. client_printcolor(id, "^4[SzerotolPenz] ^1Kaptal ^4%d Loszercsomagot^1, mert jaccotal ezen a szerveren^4 10 percet.", LARGE)
  81. }
  82.  
  83. /*================================================================================
  84.  [Stock]
  85. =================================================================================*/
  86.  
  87. stock client_printcolor(const id, const input[], any:...)
  88. {
  89. new iCount = 1, iPlayers[32]
  90. static szMsg[191]
  91.  
  92. vformat(szMsg, charsmax(szMsg), input, 3)
  93. replace_all(szMsg, 190, "/g", "^4")
  94. replace_all(szMsg, 190, "/y", "^1")
  95. replace_all(szMsg, 190, "/ctr", "^1")
  96. replace_all(szMsg, 190, "/w", "^0")
  97.  
  98. if(id) iPlayers[0] = id
  99. else get_players(iPlayers, iCount, "ch")
  100. for (new i = 0; i < iCount; i++)
  101. {
  102. if(is_user_connected(iPlayers[i]))
  103. {
  104. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
  105. write_byte(iPlayers[i])
  106. write_string(szMsg)
  107. message_end()
  108. }
  109. }
  110. }
  111.