seroff

Show Erros Logs 1.5 By Seroff

Jul 11th, 2016
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4.  
  5. public plugin_init() {
  6. register_plugin("Show Erros Logs", "1.5", "Seroff");
  7. register_logevent("event_end", 2, "1=Round_End");
  8. }
  9.  
  10. public event_end(){
  11. static dir, files[32], cErrors,cLogs,szText[32];
  12. dir = open_dir("addons/amxmodx/logs/", files, sizeof(files)-1);
  13. if (dir)
  14. {
  15. cErrors=0;
  16. cLogs=0;
  17. while (next_file(dir, files, sizeof(files)-1))
  18. {
  19. if(containi(files, ".log") != -1)
  20. {
  21. cLogs++
  22. }
  23. if(containi(files, "error_") != -1)
  24. {
  25. cErrors++;
  26. szText=files;
  27. server_print("Обноружен лог файл с ошибками: %s",files);
  28. }
  29. }
  30.  
  31. if(cErrors){
  32. Admin_ColorChat(0,"^1[^4Сервер^1] ^4Внимание^1: ^3обноружен лог файл с ошибками последний^1: [^4%s^1]!",szText);
  33. Admin_ColorChat(0,"^1[^4Сервер^1] ^4Внимание^1: ^3количество лог файлов с ошибками ^1: [^4%d^1/^4%d^1]!",cErrors,cLogs);
  34. }
  35. server_print("Количество лог файлов с ошибками: %d/%d", cErrors,cLogs);
  36. }
  37. close_dir(dir)
  38. }
  39.  
  40. stock Admin_ColorChat(id, const input[], any:...) {
  41. new count = 1, players[32];
  42. static msg[191];
  43. vformat(msg, 190, input, 3);
  44.  
  45. replace_all(msg, 187, "!g", "^4");
  46. replace_all(msg, 187, "!y", "^1");
  47. replace_all(msg, 187, "!t", "^3");
  48.  
  49. if(id) players[0] = id; else get_players(players, count, "ch");
  50. {
  51. for(new i = 0; i < count; i++) {
  52. if(!is_user_connected(players[i]) || ~get_user_flags(players[i]) & ADMIN_IMMUNITY) continue;
  53. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  54. write_byte(players[i]);
  55. write_string(msg);
  56. message_end();
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment