Raised This Month: $ Target: $400
 0% 

cl_autobuy LOG


  
 
 
Thread Tools Display Modes
Author Message
B4RNS
Junior Member
Join Date: Apr 2012
Old 09-04-2012 , 23:15   cl_autobuy LOG
#1

Bonjour tous !

je voudrais un plugin comme celui-ci :

Code:
#include <amxmodx>
#include <amxmisc>

/*////////// Comment this line (with "//") for logging without client's arguments after "autobuy " command. */
/*///////// Закомментируйте (2 слешами "//"), чтобы не писать в логах все, что игрок вводит в консоль после команды "fullupdate ". */
/*//////// Нежелательно комментировать, если Вы хотите отслеживать, кто из игроков пользуется crash-эксплоитом (autobuy). */
/*/////// Умышленно или нет игрок использует такую команду - вопрос десятый.. */
#define USE_AUTOBUY_ARGS_LOGGING



/* LOG Files ***************************************************************************************************
addons/amxmodx/logs/anti-crash/fullupdate.log          - log of cleitns, who used fullupdate commands;    *
addons/amxmodx/logs/anti-crash/fullupdate-BANNED.log   - who have a ban by this plugin;                   *
addons/amxmodx/logs/anti-crash/autobuy.log             - autobuy attempts.                                *
**********************************************************************************************************/


new currcount[33]
new logfile_fupd[128]
new logfile_fupd_ban[128]


#if defined USE_AUTOBUY_ARGS_LOGGING
    new logfile_autobuy[256]
#else
    new logfile_autobuy[128]
#endif


public plugin_init() {
    register_plugin("Anti-Crash","0.1","AloneLive")
    
    /* Client comand "fullupdate" */
    register_clcmd("fullupdate","fullupdate_block")
    
    /* Groud of client commands "AUTOBUY" */
    register_clcmd("cl_setautobuy", "autobuy_block")
    register_clcmd("cl_autobuy", "autobuy_block")
    register_clcmd("cl_setrebuy", "autobuy_block")
    register_clcmd("cl_rebuy", "autobuy_block")
    register_clcmd("autobuy", "autobuy_block")
    
    /* Translations */
    register_dictionary("anti-crash.txt")
    
    /* Log files */
    mkdir("addons/amxmodx/logs/anti-crash")
    format(logfile_fupd,127,"addons/amxmodx/logs/anti-crash/fullupdate.log",logfile_fupd)
    format(logfile_fupd_ban,127,"addons/amxmodx/logs/anti-crash/fullupdate-BANNED.log",logfile_fupd_ban)
    format(logfile_autobuy,255,"addons/amxmodx/logs/anti-crash/autobuy.log",logfile_autobuy)
    
    
    
    /* CVARS */
    /*////////// Set the max allowed count client's fullupdate commands before he will be banned. */
    /*//////// Укажите максимальное кол-во раз ввода команды fullupdate игроком перед баном. */
    register_cvar("ac_fupdate_maxcount", "5")
    
    /*//////////  Autobuy message in chat: "Autobuy is no allowed" every time when client use an autobuy command. Set "0" to disable. */
    /*//////// Анонс в чате для игрока, использующего автобай: "Автозакупка не разрешена на сервере". Установите "0", чтобы выключить. */
    register_cvar("ac_autobuy_announce", "1")
    
    /*//////////  Autobuy message in chat: "Fullupdate is no allowed" every time when client use a fullupdate command. Set "0" to disable. */
    /*//////// Анонс в чате для игрока, использующего fullupdate: "Fullupdate не разрешен на сервере". Установите "0", чтобы выключить. */
    register_cvar("ac_fullupdate_announce", "1")
    
    /*////////// Sound announce for autobuy & fullupdate commands. Set "0" to disable. */
    /*//////// Звуковой анонс для команд autobuy & fullupdate. Установите "0", чтобы выключить. */
    register_cvar("ac_sound_announce", "1")
}


public fullupdate_block(id) {
    new name[33]
    get_user_name(id, name, 32)
    new authid[35], team[32]
    new userid = get_user_userid(id)
    new ip[33]
    get_user_ip(id, ip, 32)
    get_user_authid(id,authid,34)
    get_user_team(id,team,31)
    currcount[id] = (currcount[id] + 1)
    new maxcount = (get_cvar_num("ac_fupdate_maxcount"))
    if (currcount[id] < maxcount) {
        
        if(get_cvar_num("ac_fullupdate_announce") == 1) {
            client_print(id, print_chat, "%L", LANG_PLAYER, "FUWARN", name,currcount[id],maxcount)
        }
        if(get_cvar_num("ac_sound_announce") == 1) {
            new c_spkstr[24]
            new m_spkstr[24]
            num_to_word(currcount[id], c_spkstr, 23);
            num_to_word(maxcount, m_spkstr, 23);
            client_cmd(id, "spk ^"vox/bizwarn %s of %s^"", c_spkstr,m_spkstr)

        }

        log_to_file(logfile_fupd, "^"%s<%d><%s><%s><%s>^" use a *fullupdate* command (%i/%i)",name,userid,authid,team,ip,currcount[id],maxcount)
        return PLUGIN_HANDLED
    }
    
    else if (currcount[id] == maxcount) {
        client_print(0, print_chat, "%L", LANG_PLAYER, "FUBAN", name)        
        server_cmd("amx_addban ^"%s^" 0 ^"Attempted server crash.^"", authid)
        log_to_file(logfile_fupd_ban, "^"%s<%d><%s><%s><%s>^" got permanent ban. Reason: Attempted server crash.",name,userid,authid,team,ip)
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_CONTINUE
}

public autobuy_block(id){
    new name[33]
    get_user_name(id, name, 32)
    new authid[35], team[32]
    new userid = get_user_userid(id)
    new ip[33]
    get_user_ip(id, ip, 32)
    get_user_authid(id,authid,34)
    get_user_team(id,team,31)
    new CurrentDateTime[24]
    get_time("%d/%m/%YYYY - %HH:%MM:%SS",CurrentDateTime,23)
    
    if(get_cvar_num("ac_autobuy_announce") == 1) {
        client_print(id, print_chat, "%L", LANG_PLAYER, "ABNA")
        client_print(id, print_chat, "%L", LANG_PLAYER, "ABNA2")
    }
    if(get_cvar_num("ac_sound_announce") == 1) {
        client_cmd(id, "spk vox/bizwarn")
    }
    
    #if defined USE_AUTOBUY_ARGS_LOGGING
        new cl_args[128]
        read_args(cl_args, 127)
        log_to_file(logfile_autobuy, "^"%s<%d><%s><%s><%s>^" used AUTOBUY command. (Arguments: %s)",name,userid,authid,team,ip,cl_args)
    #else
        log_to_file(logfile_autobuy, "^"%s<%d><%s><%s><%s>^" used AUTOBUY command.",name,userid,authid,team,ip)
    #endif
    
    return PLUGIN_HANDLED
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
Mais sans la "restrict" ni le "warning" message et ni le son !
J'aimerais juste la fonction du "LOG file"

Merci au magicien qui va pouvoir modifier le code ma guise

Cordialement
B4RNS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-05-2012 , 01:33   Re: cl_autobuy LOG
#2

J'utilise a normalement a fonctionne bien.
Tu retrouves les logs dans $MOD/addons/amxmodx/logs/AutoBuy.log

En passant, cs-amx.fr a r-ouvert, a permet d'y concentrer la communaut fr, et surtout d'avoir un forum avec des sous-forums
Attached Files
File Type: sma Get Plugin or Get Source (autobuy_fix.sma - 1539 views - 2.8 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-05-2012 at 01:34.
ConnorMcLeod is offline
B4RNS
Junior Member
Join Date: Apr 2012
Old 09-05-2012 , 08:55   Re: cl_autobuy LOG
#3

Super !! Je viens de tester , plus de crash , a a l'air de fonctionner ;)
Un grand MERCI toi

Yes !!! Trop gnial pour cs-amx.fr

Last edited by B4RNS; 09-05-2012 at 08:58.
B4RNS is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 09-05-2012 , 17:12   Re: cl_autobuy LOG
#4

huh ? ce crash existe toujours ? Il me semble qu'il a t rgl dans les rcente updates ?

Last edited by Fr33m@n; 09-05-2012 at 17:12.
Fr33m@n is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-06-2012 , 00:40   Re: cl_autobuy LOG
#5

Eh non.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode