seroff

Nice RR 2.0.1 By Seroff & sector

Dec 9th, 2017
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new Timer, MSG, FLAG_ADMIN=ADMIN_LEVEL_A, nrr_sound, PLUGIN[][]={"Nice RR","2.0.1","Seroff & sector"},szFlog[]="addons/amxmodx/logs/nice_rr.txt";
  4.  
  5. public plugin_init() {
  6. register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]);
  7. nrr_sound = register_cvar("nrr_sound", "1");
  8. register_clcmd("rr", "nice_rr");
  9. MSG = CreateHudSyncObj();
  10. }
  11.  
  12. public nice_rr(id){
  13. if(get_user_flags(id) & FLAG_ADMIN){
  14. new Name[33];
  15. get_user_name(id, Name, 33);
  16. log_to_file(szFlog, "[Nice RR] <%s> - This administrator made a server restart.", Name);
  17. console_print(id, "[Nice RR] Рестарт сервера успешно запущен. Отчёт произойдёт через 3 сек.");
  18. set_task(3.0, "nice_rr_func");
  19. } else {
  20. console_print(id, "[Nice RR] В доступе отказано!");
  21. if(get_pcvar_num(nrr_sound)) {
  22. emit_sound(id,0,"ambience/thunder_clap.wav",1.0, 1.0, 0, 100 );
  23. }
  24. }
  25. return PLUGIN_HANDLED
  26. }
  27.  
  28. public nice_rr_func(){
  29. Timer = 10;
  30. set_task(1.0, "nice_timer", _, _, _, "a", 10);
  31. }
  32.  
  33. public nice_timer(){
  34. set_hudmessage(255, 255, 255, 0.40, 0.80, 0, 6.0, 6.0, 0.5, 0.15, -1);
  35. ShowSyncHudMsg(0, MSG, "[Nice RR] Внимание игроки!^nЗапущен рестарт сервера!^nОн произойдёт через %d сек.", Timer);
  36. if(Timer == 1){
  37. server_cmd("restart");
  38. }
  39. Timer--;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment