Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- public plugin_init() {
- register_plugin("Show Erros Logs", "1.5", "Seroff");
- register_logevent("event_end", 2, "1=Round_End");
- }
- public event_end(){
- static dir, files[32], cErrors,cLogs,szText[32];
- dir = open_dir("addons/amxmodx/logs/", files, sizeof(files)-1);
- if (dir)
- {
- cErrors=0;
- cLogs=0;
- while (next_file(dir, files, sizeof(files)-1))
- {
- if(containi(files, ".log") != -1)
- {
- cLogs++
- }
- if(containi(files, "error_") != -1)
- {
- cErrors++;
- szText=files;
- server_print("Обноружен лог файл с ошибками: %s",files);
- }
- }
- if(cErrors){
- Admin_ColorChat(0,"^1[^4Сервер^1] ^4Внимание^1: ^3обноружен лог файл с ошибками последний^1: [^4%s^1]!",szText);
- Admin_ColorChat(0,"^1[^4Сервер^1] ^4Внимание^1: ^3количество лог файлов с ошибками ^1: [^4%d^1/^4%d^1]!",cErrors,cLogs);
- }
- server_print("Количество лог файлов с ошибками: %d/%d", cErrors,cLogs);
- }
- close_dir(dir)
- }
- stock Admin_ColorChat(id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 187, "!g", "^4");
- replace_all(msg, 187, "!y", "^1");
- replace_all(msg, 187, "!t", "^3");
- if(id) players[0] = id; else get_players(players, count, "ch");
- {
- for(new i = 0; i < count; i++) {
- if(!is_user_connected(players[i]) || ~get_user_flags(players[i]) & ADMIN_IMMUNITY) continue;
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment