Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. #include <amxmodx>
  2. #include < amxmisc >
  3.  
  4. const TASK_ID = 258;
  5.  
  6. new h;
  7. new task_set = 0;
  8. new inceput;
  9. new sfarsit;
  10.  
  11. public plugin_init()
  12. {
  13. register_plugin("Dam la saraci vip", "1.0", "cyby")
  14.  
  15. inceput = register_cvar( "vip_start", "20" );
  16. sfarsit = register_cvar( "vip_end", "23" )
  17. }
  18.  
  19. public client_putinserver(id)
  20. {
  21. new o, m, s;
  22. time(o, m, s)
  23. if(o >= get_pcvar_num( inceput ) && o < get_pcvar_num( sfarsit ))
  24. {
  25. if( get_user_flags(id) != read_flags("t") || !( get_user_flags( id ) & ADMIN_LEVEL_H ) )
  26. {
  27. set_user_flags(id, read_flags("t"))
  28. set_task(3.0, "mesaj", id)
  29. set_task(1.0, "hud_mess", _, _, _, "b")
  30. set_task(60.0, "incepe", id)
  31. set_task(60.0, "terminare", id)
  32. }
  33.  
  34. if( !task_set )
  35. {
  36. set_task( 60.0, "recheck", TASK_ID, _, _, "b" ); // task pus la 1 minut pentru a functiona corect
  37. task_set = 1;
  38. }
  39. }
  40. }
  41. public recheck()
  42. {
  43.  
  44. time( h, _, _ );
  45.  
  46. if( h >= 23 )
  47. {
  48. new iPlayers[ 32 ], iNum, i;
  49. get_players( iPlayers, iNum );
  50.  
  51. for( i = 0; i < iNum; i++ )
  52. {
  53. remove_user_flags( iPlayers[ i ] );
  54. }
  55.  
  56. server_cmd( "amx_reloadadmins" );
  57.  
  58. remove_task( TASK_ID );
  59. task_set = 0;
  60. }
  61. }
  62. public incepe(id)
  63. {
  64. new o, m, s;
  65. time(o, m, s)
  66. if(o == get_pcvar_num( inceput ) )
  67. {
  68. chat_color(id, "!t[FURIEN] !nEventul !tVIP SILVER FREE !na inceput !g!")
  69. }
  70. }
  71. public terminare(id)
  72. {
  73. new o, m, s;
  74. time(o, m, s)
  75. if(o == get_pcvar_num( sfarsit ) )
  76. {
  77. chat_color(id, "!t[FURIEN] !nEventul !tVIP SILVER FREE !as-a terminat !g!")
  78. }
  79. }
  80. public hud_mess()
  81. {
  82. new o, m, s;
  83. time(o, m, s)
  84. if(o >= get_pcvar_num( inceput ) && o < get_pcvar_num( sfarsit ))
  85. {
  86. set_hudmessage(random(256), random(256), random(256), 0.03, 0.03, 1, 1.0, 1.1, 0.1, 0.1, -1)
  87. show_hudmessage(0, "EVENT VIP SILVER FREE !")
  88. }
  89. }
  90. public mesaj(id)
  91. if( get_user_flags(id) != read_flags("t") || !( get_user_flags( id ) & ADMIN_LEVEL_H ) )
  92. {
  93. {
  94. chat_color(id, "!t[FURIEN] !nAi primit !tVIP SILVER !npentru ca este event !tVIP SILVER FREE !nintre orele!g %d:00 !nsi!g %d:00 !n!", get_pcvar_num( inceput ), get_pcvar_num( sfarsit ))
  95. }
  96. }
  97. stock chat_color(const id, const input[], any:...)
  98. {
  99. new count = 1, players[32]
  100. static msg[320]
  101. vformat(msg, 190, input, 3)
  102. replace_all(msg, 190, "!g", "^4")
  103. replace_all(msg, 190, "!n", "^1")
  104. replace_all(msg, 190, "!t", "^3")
  105. replace_all(msg, 190, "!t2", "^0")
  106. if (id) players[0] = id; else get_players(players, count, "ch")
  107. {
  108. for (new i = 0; i < count; i++)
  109. {
  110. if (is_user_connected(players[i]))
  111. {
  112. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  113. write_byte(players[i])
  114. write_string(msg)
  115. message_end()
  116. }
  117. }
  118. }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement