HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Script generated by Pawn Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #define fTask 15.0
  7.  
  8. new const Autor[] = "Chatto."
  9. new const Name[] = "Notifications of festivities"
  10. new const Vers[] = " 1.0 "
  11. new const szPrfx[] = "!g[Unnepek]!y"
  12.  
  13. new const szHolydays[ ][ ] =
  14. {
  15. "25",
  16. "31",
  17. "01",
  18. "31"
  19. }
  20.  
  21. new const szMonths[ ][ ] =
  22. {
  23. "October",
  24. "December",
  25. "January"
  26. }
  27.  
  28. new gMaxPlayers;
  29.  
  30. public plugin_init()
  31. {
  32. register_plugin(Name, Vers, Autor)
  33. register_logevent("RoundStart", 2, "1=Round_Start")
  34. gMaxPlayers = get_maxplayers();
  35. }
  36. public RoundStart( )
  37. {
  38. for( new i = 1; i < gMaxPlayers; i++ )
  39. {
  40. set_task( fTask, "Recording", i )
  41. }
  42. }
  43. public Recording( id )
  44. {
  45. new Month[33], Day[12];
  46. get_time( "%B", Month, charsmax(Month) )
  47. get_time( "%d", Day, charsmax(Day) )
  48.  
  49. new Christmas = str_to_num(szHolydays[ 0 ]) - str_to_num(Day)
  50. new Halloween = str_to_num(szHolydays[ 3 ]) - str_to_num(Day)
  51. new LastDay_ofAge = str_to_num(szHolydays[ 1 ]) - str_to_num(Day)
  52.  
  53. if( equali( Month, szMonths[0] ) )
  54. {
  55. ChatColor( id, "%s Meg!t %d nap van!t Halloween-ig", szPrfx, Halloween )
  56. }
  57. else if( equali( Month, szMonths[1] ) )
  58. {
  59. ChatColor( id, "%s Meg !t %d!y nap van!t Karacsonyig", szPrfx, Christmas )
  60. ChatColor( id, "%s Meg !t %d!y nap van!t Szilveszterig", szPrfx, LastDay_ofAge )
  61. }
  62. else if( equali( Month, szMonths[2] ) )
  63. {
  64. if( equal( Day, szHolydays[3] ) )
  65. {
  66. ChatColor( id, "%s Boldog uj evet!", szPrfx )
  67. }
  68. }
  69. }
  70.  
  71. stock ChatColor(const id, const input[], any:...)
  72. {
  73. new count = 1, players[32];
  74. static msg[191];
  75. vformat(msg, 190, input, 3);
  76.  
  77. replace_all(msg, 190, "!g", "^4"); // Color verde
  78. replace_all(msg, 190, "!y", "^1"); // Default
  79. replace_all(msg, 190, "!t", "^3"); // Team Color
  80.  
  81. if (id) players[0] = id; else get_players(players, count, "ch");
  82. {
  83. for (new i = 0; i < count; i++)
  84. {
  85. if (is_user_connected(players[i]))
  86. {
  87. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  88. write_byte(players[i]);
  89. write_string(msg);
  90. message_end();
  91. }
  92. }
  93. }
  94. }
  95.