Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new a[6]
  4.  
  5. public plugin_init()
  6. {
  7. register_plugin("Map Scheduler", "1", "PRO-CS")
  8.  
  9. set_task(60.0, "task_check_time", 38427236, _, _, "b")
  10. }
  11.  
  12. public task_check_time()
  13. {
  14. get_time("%H:%M", a, 5)
  15.  
  16. if (equal(a, "23:59"))
  17. {
  18. chat_color(0, "!g[TRUST] !nEste ora !g23:59 !nserverul trece pe setarile de noapte.")
  19. }
  20.  
  21. if (equal(a, "00:00"))
  22. {
  23. server_cmd("amx_map MAPA")
  24. }
  25.  
  26. if (equal(a, "00:05"))
  27. {
  28. server_cmd("amx_rcon mp_timelimit 0")
  29. server_cmd("amx_pausecfg stop adminvote")
  30. server_cmd("amx_pausecfg stop mapchooser")
  31. server_cmd("amx_pausecfg stop mapsmenu")
  32. }
  33.  
  34. if (equal(a, "01:00"))
  35. {
  36. server_cmd("amx_map MAPA")
  37. }
  38.  
  39. if (equal(a, "01:05"))
  40. {
  41. server_cmd("amx_rcon mp_timelimit 0")
  42. server_cmd("amx_pausecfg stop adminvote")
  43. server_cmd("amx_pausecfg stop mapchooser")
  44. server_cmd("amx_pausecfg stop mapsmenu")
  45. }
  46.  
  47. if (equal(a, "02:00"))
  48. {
  49. server_cmd("amx_map MAPA")
  50. }
  51.  
  52. if (equal(a, "02:05"))
  53. {
  54. server_cmd("amx_rcon mp_timelimit 0")
  55. server_cmd("amx_pausecfg stop adminvote")
  56. server_cmd("amx_pausecfg stop mapchooser")
  57. server_cmd("amx_pausecfg stop mapsmenu")
  58. }
  59.  
  60. if (equal(a, "03:00"))
  61. {
  62. server_cmd("amx_map MAPA")
  63.  
  64. }
  65.  
  66. if (equal(a, "03:05"))
  67. {
  68. server_cmd("amx_rcon mp_timelimit 0")
  69. server_cmd("amx_pausecfg stop adminvote")
  70. server_cmd("amx_pausecfg stop mapchooser")
  71. server_cmd("amx_pausecfg stop mapsmenu")
  72. }
  73.  
  74. if (equal(a, "04:00"))
  75. {
  76. server_cmd("amx_map MAPA")
  77. }
  78.  
  79. if (equal(a, "04:05"))
  80. {
  81. server_cmd("amx_rcon mp_timelimit 0")
  82. server_cmd("amx_pausecfg stop adminvote")
  83. server_cmd("amx_pausecfg stop mapchooser")
  84. server_cmd("amx_pausecfg stop mapsmenu")
  85. }
  86.  
  87. if (equal(a, "05:00"))
  88. {
  89. server_cmd("amx_map MAPA")
  90. }
  91.  
  92. if (equal(a, "05:05"))
  93. {
  94. server_cmd("amx_rcon mp_timelimit 0")
  95. server_cmd("amx_pausecfg stop adminvote")
  96. server_cmd("amx_pausecfg stop mapchooser")
  97. server_cmd("amx_pausecfg stop mapsmenu")
  98. }
  99. if (equal(a, "06:00"))
  100. {
  101. server_cmd("amx_map MAPA")
  102. }
  103.  
  104. if (equal(a, "06:05"))
  105. {
  106. server_cmd("amx_rcon mp_timelimit 0")
  107. server_cmd("amx_pausecfg stop adminvote")
  108. server_cmd("amx_pausecfg stop mapchooser")
  109. server_cmd("amx_pausecfg stop mapsmenu")
  110. }
  111.  
  112. if (equal(a, "07:00"))
  113. {
  114. server_cmd("amx_map MAPA")
  115. }
  116.  
  117. if (equal(a, "07:05"))
  118. {
  119. server_cmd("amx_rcon mp_timelimit 0")
  120. server_cmd("amx_pausecfg stop adminvote")
  121. server_cmd("amx_pausecfg stop mapchooser")
  122. server_cmd("amx_pausecfg stop mapsmenu")
  123. }
  124.  
  125. if (equal(a, "07:50"))
  126. {
  127. server_cmd("amx_map MAPA")
  128. }
  129.  
  130. if (equal(a, "07:55"))
  131. {
  132. server_cmd("amx_rcon mp_timelimit 30")
  133. }
  134.  
  135. if (equal(a, "08:00"))
  136. {
  137. chat_color(0, "!g[TRUST] !nEste ora !g08:00 !nserverul trece pe setarile de zi.")
  138. }
  139. }
  140.  
  141.  
  142. stock chat_color(const id, const input[], any:...)
  143. {
  144. new count = 1, players[32]
  145.  
  146. static msg[191]
  147.  
  148. vformat(msg, 190, input, 3)
  149.  
  150. replace_all(msg, 190, "!g", "^4")
  151. replace_all(msg, 190, "!n", "^1")
  152. replace_all(msg, 190, "!t", "^3")
  153. replace_all(msg, 190, "!t2", "^0")
  154.  
  155. if (id) players[0] = id; else get_players(players, count, "ch")
  156. {
  157. for (new i = 0; i < count; i++)
  158. {
  159. if (is_user_connected(players[i]))
  160. {
  161. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  162. write_byte(players[i])
  163. write_string(msg)
  164. message_end()
  165. }
  166. }
  167. }
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement