Modifcar este plugin para ignorar a los BOTS
#1
Buenas gente! Este plugin lo que hace es kickear a la gente que entra con el comando vgui_menus en otro valor que no sea "1". Esto también incluye a los bots que he instalado recientemente al servidor. Lo que quiero es que el plugin ignore a los BOTS y no los kickee del servidor. De antemano gracias Gran sonrisa


Archivos adjuntos
.sma   Descargar AMXX / kick_oldstylemenu.sma (Tamaño: 1.43 KB / Descargas: 2)
Responder
#2
Código PHP:
#include <amxmodx>
#include <engine>

new const szPlugin[ ][ ] = { "Check VGui Menu""1.0""Sky^^" };
new const 
szPrefix[ ] = "^3[ CxS ]^1";
new const 
szEntityName[ ] = "Entity_VGuiMenu";

public 
plugin_init( ) register_pluginszPlugin], szPlugin], szPlugin] );
public 
plugin_precache( ) {
    new 
ent create_entity"info_target" );

    
entity_set_stringentEV_SZ_classnameszEntityName );
    
entity_set_floatentEV_FL_nextthinkget_gametime( ) + 0.1 );

    
register_thinkszEntityName"ft_ThinkEntity" );
}

public 
ft_ThinkEntityent ) {
    if( !
is_valid_entent )) return;

    static 
id;
    for( 
id 1id <= get_maxplayers( ); id++ ) {
        if( !
is_user_connectedid ) || is_user_bot(id)) continue;

        new 
szValue10 ], szNameMAX_NAME_LENGTH ];

        
get_user_infoid"_vgui_menus"szValuecharsmaxszValue ) );
        
get_user_infoid"name"szNamecharsmaxszName ) );

        new 
iValue;
        
iValue str_to_numszValue );

        if( 
iValue != ) {
            
client_print_color0print_team_default"%s ^4%s^1 fue kickeado por usar el^4 _vgui_menus^1 en^4 %d^1."szPrefixszNameszValueiValue );
            
server_cmd"kick #%d ^"Para ingresarpon en consola sin la parte que dice (ESPACIO): setinfo(ESPACIO)_vgui_menus(ESPACIO)1^""get_user_useridid ) );
        }
    }

    
entity_set_floatentEV_FL_nextthinkget_gametime( ) + 0.1 );

"Cada golpe es una lección, y cada lección te hace mejor."

[Imagen: b_350_20_000000_8a7300_ffffff_eeff00.png]
[Imagen: 76561198371193937.png]
Responder
#3
(07/08/2021, 12:13 AM)rojedafeik escribió:
Código PHP:
#include <amxmodx>
#include <engine>

new const szPlugin[ ][ ] = { "Check VGui Menu""1.0""Sky^^" };
new const 
szPrefix[ ] = "^3[ CxS ]^1";
new const 
szEntityName[ ] = "Entity_VGuiMenu";

public 
plugin_init( ) register_pluginszPlugin], szPlugin], szPlugin] );
public 
plugin_precache( ) {
    new ent create_entity"info_target" );

    entity_set_stringentEV_SZ_classnameszEntityName );
    entity_set_floatentEV_FL_nextthinkget_gametime( ) + 0.1 );

    register_thinkszEntityName"ft_ThinkEntity" );
}

public 
ft_ThinkEntityent ) {
    if( !is_valid_entent )) return;

    static id;
    for( id 1id <= get_maxplayers( ); id++ ) {
        if( !is_user_connectedid ) || is_user_bot(id)) continue;

        new szValue10 ], szNameMAX_NAME_LENGTH ];

        get_user_infoid"_vgui_menus"szValuecharsmaxszValue ) );
        get_user_infoid"name"szNamecharsmaxszName ) );

        new iValue;
        iValue str_to_numszValue );

        if( iValue != ) {
            client_print_color0print_team_default"%s ^4%s^1 fue kickeado por usar el^4 _vgui_menus^1 en^4 %d^1."szPrefixszNameszValueiValue );
            server_cmd"kick #%d ^"Para ingresarpon en consola sin la parte que dice (ESPACIO): setinfo(ESPACIO)_vgui_menus(ESPACIO)1^""get_user_useridid ) );
        }
    }

    entity_set_floatentEV_FL_nextthinkget_gametime( ) + 0.1 );



Muchas gracias amigo! Si funciona! Gran sonrisa
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)