Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- static i_logfolder;
- public plugin_init()
- {
- register_plugin("Log Show", "1.2", "Seroff");
- register_clcmd("show_log","logshow");
- i_logfolder=register_cvar("show_logs_dir","addons/amxmodx/logs/");
- }
- public logshow(id){
- if(get_user_flags(id) & ADMIN_IMMUNITY){
- logss(id);
- }
- else
- {
- console_print(id,"Не достаточно пиздат для использования этой команды!");
- }
- return 1;
- }
- public logss(id){
- new szFolder[64],szlog[128],szArg[64];
- read_argv(1,szArg,charsmax(szArg));
- get_pcvar_string(i_logfolder,szFolder,63)
- format(szlog, 63, "/%s/%s", szFolder, szArg)
- new iFile = fopen( szlog, "rt" );
- if( !iFile )
- {
- console_print(id,"Ошибка файл %s в папке %s отсутствует!",szArg,szFolder);
- }
- else
- {
- while( !feof( iFile ) )
- {
- static szText[ 92 ]; fgets( iFile, szText, charsmax( szText ) ); trim( szText );
- if( !strlen( szText ) || szText[ 0 ] == ';' || ( szText[ 0 ] == '/' && szText[ 1 ] == '/' ) ) continue;
- console_print(id,"Папка: %s; Файл: %s",szFolder,szArg);
- console_print(id,szText);
- }
- }
- fclose( iFile );
- }
- /*
- Админский плагин который показывает что есть в лог файле прям в игре не выходя с сервера!
- При вводе команды show_log выводится то что находится в файле, который указан в кваре.
- Настройки:
- show_logs_dir "addons/amxmodx/logs/" // папка где находится лог файл
- show_logs_file "123.log" // лог файл
- */
Advertisement
Add Comment
Please, Sign In to add comment