iFenomenal

Free vip

Jan 11th, 2020
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new const TAG[] = "[TAG]";
  4.  
  5. new bool:vip_free, g_msg_saytext;
  6.  
  7. public plugin_init()
  8. {
  9. register_plugin("Free VIP Giver", "2.0", "cyby")
  10. check_time()
  11. set_task(60.0, "check_time", _, _, _, "b")
  12. set_task(1.0, "hud_mess", _, _, _, "b")
  13.  
  14. g_msg_saytext = get_user_msgid("SayText");
  15. }
  16.  
  17. public check_time()
  18. {
  19. static preluare_ora[3], ora;
  20. get_time("%H", preluare_ora, 2)
  21. ora = str_to_num(preluare_ora)
  22. if(22 >= ora || ora <= 8)
  23. {
  24. if(!vip_free)
  25. color(0, ".v%s.g Este ora.e 22:00.g!!Toti jucatori aveti vip free!", TAG)
  26. vip_free = true
  27. server_cmd("amx_default_access ^"x^"")
  28. }
  29. else
  30. {
  31. if(vip_free)
  32. color(0, ".v%s.g Este ora.e 10:00.g!!Eventul free s-a sfarsit!", TAG)
  33. vip_free = false
  34. server_cmd("amx_default_access ^"z^"")
  35. }
  36. server_cmd("amx_reloadadmins")
  37. }
  38.  
  39. public hud_mess()
  40. {
  41. if(vip_free)
  42. {
  43. set_hudmessage(random(0), random(255), random(0), 0.00, 0.17, 1, 1.0, 1.0, 0.1, 0.1)
  44. show_hudmessage(0, "Event V.I.P FREEE !")
  45. }
  46. }
  47.  
  48. stock color(const id, const input[], any:...)
  49. {
  50. new count = 1, players[32]
  51. static msg[191]
  52. vformat(msg, 190, input, 3)
  53.  
  54. replace_all(msg, 190, ".v", "^4")
  55. replace_all(msg, 190, ".g", "^1")
  56. replace_all(msg, 190, ".e", "^3")
  57.  
  58. if(id) players[0] = id; else get_players(players, count, "ch")
  59. {
  60. for(new i = 0; i < count; i++)
  61. {
  62. if(is_user_connected(players[i]))
  63. {
  64. message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, players[i])
  65. write_byte(players[i]);
  66. write_string(msg);
  67. message_end();
  68. }
  69. }
  70. }
  71. }
Add Comment
Please, Sign In to add comment