Plugin autobuy_fix

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
smileye
Fost moderator
Fost moderator
Posts: 4655
Joined: 12 Jun 2012, 14:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

28 Jul 2012, 16:51

Vreau sa imi modificati sma-ul sa aiba cvar-urile:

0 - Dezactivata protectia
1 - Kick
2 - Ban x min pe IP ( setati 30min)
3 - TIMEOUT
| Afiseaza codul
#include <amxmodx> 

#define PLUGIN_NAME       "Fix AutoBuy Bug" 
#define PLUGIN_VERSION    "1.1" 
#define PLUGIN_AUTHOR     "PomanoB / UFPS.Team"

new g_logfile[64] 

public plugin_init( ) 
{ 
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR ) 

    register_clcmd( "cl_setautobuy", "cmd_check" ) 
    register_clcmd( "cl_setrebuy", "cmd_check" ) 

    get_time ( "autobuy_%Y%m.log", g_logfile, charsmax ( g_logfile ) ) 
} 

public cmd_check( id ) 
{ 
    static arg[512], args, i 
    args = read_argc( ) 

    for( i = 1; i < args; ++i ) 
    { 
        read_argv( i, arg, charsmax( arg ) ) 

        if( is_cmd_long( arg, charsmax( arg ) ) ) 
        { 
            log_autobuy( id ) 
            return PLUGIN_HANDLED 
        } 
    } 

    return PLUGIN_CONTINUE 
} 

stock bool:is_cmd_long( string[], const len ) 
{ 
    static cmd[512] 

    while( strlen( string ) ) 
    { 
        strtok( string, cmd, charsmax( cmd ), string, len , ' ', 1 ) 

        if( strlen( cmd ) > 31 ) return true 
    } 

    return false 
} 

stock log_autobuy( id ) 
{ 
    static name[32], steamid[44], ip[16] 
    get_user_ip( id, ip, charsmax( ip ), 1 ) 
    get_user_authid( id, steamid, charsmax( steamid ) ) 
    get_user_name( id, name, charsmax( name ) ) 

    log_to_file( g_logfile, "Autobuy bug use: %s [%s] <%s>", name, ip, steamid ) 
}
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests