#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_plugin( szPlugin[ 0 ], szPlugin[ 1 ], szPlugin[ 2 ] );
public plugin_precache( ) {
new ent = create_entity( "info_target" );
entity_set_string( ent, EV_SZ_classname, szEntityName );
entity_set_float( ent, EV_FL_nextthink, get_gametime( ) + 0.1 );
register_think( szEntityName, "ft_ThinkEntity" );
}
public ft_ThinkEntity( ent ) {
if( !is_valid_ent( ent )) return;
static id;
for( id = 1; id <= get_maxplayers( ); id++ ) {
if( !is_user_connected( id ) || is_user_bot(id)) continue;
new szValue[ 10 ], szName[ MAX_NAME_LENGTH ];
get_user_info( id, "_vgui_menus", szValue, charsmax( szValue ) );
get_user_info( id, "name", szName, charsmax( szName ) );
new iValue;
iValue = str_to_num( szValue );
if( iValue != 1 ) {
client_print_color( 0, print_team_default, "%s ^4%s^1 fue kickeado por usar el^4 _vgui_menus^1 en^4 %d^1.", szPrefix, szName, szValue, iValue );
server_cmd( "kick #%d ^"Para ingresar, pon en consola sin la parte que dice (ESPACIO): setinfo(ESPACIO)_vgui_menus(ESPACIO)1^"", get_user_userid( id ) );
}
}
entity_set_float( ent, EV_FL_nextthink, get_gametime( ) + 0.1 );
}