#include < amxmodx >
#include < sqlx >
#include < amxmisc >
#include < hns_print_color >
#include < fakemeta >
#include < hamsandwich >
#define MYSQL_HOST "190.210.244.26"
#define MYSQL_USER "alservers"
#define MYSQL_PASS "passwordanotherservidoresee"
#define MYSQL_DATEBASE "anotherlevel"
#define PLUGIN "EasyBans - EasyAdmines"
#define VERSION "2.0.414"
#define AUTHOR "cLAANS"
//#define SQLITE_DATEBASE "bans"
#define SetBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearBit(%1,%2) ( %1 &= ~ ( 1 << ( %2 & 31 ) ) )
#define IsBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
new const szTable[ ] = "tBans";
new const TASK_TAKEHID = 2222;
new const TASK_BAN_MENU = 5555;
new Handle:g_hTuple;
new g_id_ban[ 33 ];
new idBan[ 33 ];
new idJugadorBan[ 33 ];
new g_id[ 33 ];
new g_hid[ 33 ][ 35 ];
new g_last_players_desconectados;
new g_last_playername[ 500 ][ 32 ];
new g_last_id[ 500 ];
new g_minutos_ban[ 33 ];
new g_razon_ban[ 33 ][ 128 ];
new cvar_output;
new g_maxplayers;
new g_tiempo_jugador[ 33 ];
new g_setinfo[ 33 ][ 40 ];
new g_errores_setinfo[ 33 ];
new g_nombre_admin[ 33 ][ 32 ];
new g_flags_admin[ 33 ][ 22 ];
enum
{
GUARDAR_DATOS,
UNBAN_PLAYER,
CHEQUEAR_ESTADO,
INGRESO_NUEVO_JUGADOR,
CHEQUEAR_BAN,
CHEQUEAR_ADMIN
};
new g_indentificador_sv[ 2 ];
/* Vencimiento del admin */
new g_fechaVencimientoAdmin[ 33 ][ 7 ][ 12 ];
public asdjorge( id )
{
hns_print_color( 0,0, "tu id: %d", id );
}
public plugin_init( )
{
new iAddress[ 22 ];
get_cvar_string("net_address", iAddress[ 0 ], charsmax( iAddress ) )
register_plugin( PLUGIN, VERSION, AUTHOR );
cvar_output = get_cvar_pointer( "__sxei_output" );
register_clcmd( "asd", "asdjorge" );
register_clcmd( "say /vencimiento", "clcmd_vencimiento_admin" )
register_clcmd( "al_unban_staff", "clcmd_unban" );
register_clcmd( "say /ban", "show_menu_players_bannear");
register_clcmd( "say /banlast", "show_menu_players_bannear_last");
register_clcmd( "ban", "show_menu_players_bannear");
register_clcmd( "INTRODUCIR_RAZON", "introducir_razon" );
register_clcmd( "INTRODUCIR_RAZON_BAN_LAST", "introducir_razon_ban_last")
register_clcmd( "INTRODUCIR_MINUTOS", "introducir_minutos" );
// register_clcmd( "INTRODUCIR_SETINFO", "introducir_setinfo_admin")
register_menu( "Menu_UnBanJugador", (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9), "Menu_UnBanJugadorHandler")
register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged")
register_clcmd( "tcaracteres", "tcaracteres" );
register_event( "HLTV", "round_start" , "a", "1=0", "2=0" );
if( equal( iAddress, "190.210.244.26:27015" ) )
copy( g_indentificador_sv, 1, "a" );
else if( equal( iAddress, "190.210.244.26:27016" ) )
copy( g_indentificador_sv, 1, "b" );
else if( equal( iAddress, "190.210.244.26:27017" ) )
copy( g_indentificador_sv, 1, "c" );
else if( equal( iAddress, "190.210.244.26:27018" ) )
copy( g_indentificador_sv, 1, "d" );
else if( equal( iAddress, "190.210.244.26:27019" ) )
copy( g_indentificador_sv, 1, "e" );
else if( equal( iAddress, "190.210.244.26:27020" ) )
copy( g_indentificador_sv, 1, "f" );
else if( equal( iAddress, "190.210.244.26:27021" ) )
copy( g_indentificador_sv, 1, "g" );
g_maxplayers = get_maxplayers( );
MySQLx_Init( );
}
public tcaracteres( id )
{
new servidor[ 2 ];
new tiempo[ 15 ];
new data[ 100 ];
get_user_info( id, "_c_rate", data, 99 );
strtok( data, servidor, 1, tiempo, 14, ' ' );
hns_print_color( 0, 0, "A %s %s", servidor, tiempo );
hns_print_color( 0, 0, "B %s ", tiempo );
hns_print_color( 0, 0, "C %s ", servidor );
if( equal( servidor, g_indentificador_sv ) )
{
hns_print_color( 0, 0, "asdasd" );
}
}
public plugin_cfg( )
{
if(is_plugin_loaded("Pause Plugins") != -1)
server_cmd("amx_pausecfg add ^"EasyBans^"")
}
public round_start( )
{
for( new id = 0; id <= g_maxplayers; id++ )
{
if( !is_user_connected( id ) )
continue;
if( g_id[ id ] == 0 || strlen( g_hid[ id ] ) < 10 )
{
if( ( get_systime( ) - g_tiempo_jugador[ id ] ) > 60 )
{
set_task( 1.0, "test_hid", id+TASK_TAKEHID, _, _, "b" );
}
}
}
}
/* ============================================================== */
/* ================== [ BAN JUGADORES ONLINE ] ================== */
/* ============================================================== */
public show_menu_players_bannear( id )
{
if( !( get_user_flags(id) & ADMIN_KICK ) )
return PLUGIN_HANDLED;
new menu = menu_create("\y[EasyBan]\w Jugadores online", "PlayerMenuHandler"), iMenu[ 406 ], iLen = 0;
new players[ 32 ], pnum, tempid, szName[ 32 ], szTempid[ 10 ];
iLen += formatex( iMenu[ iLen ], charsmax( iMenu ) - iLen, "\wBanear durante: \y%s^n^n", g_minutos_ban[ id ] == 0 ? "5 minutos" : g_minutos_ban[ id ] == 1 ? "15 minutos" : g_minutos_ban[ id ] == 2 ? "30 minutos" : g_minutos_ban[ id ] == 3 ? "1 hora" : g_minutos_ban[ id ] == 4 ? "3 horas" : g_minutos_ban[ id ] == 5 ? "12 horas" : g_minutos_ban[ id ] == 6 ? "1 Dia" : "Permamente" );
menu_additem( menu, iMenu );
get_players( players, pnum );
for( new i = 0; i < pnum; i++ )
{
tempid = players[ i ];
if( (get_user_flags( tempid ) & ADMIN_KICK) && !(get_user_flags( id ) & ADMIN_IMMUNITY ) )
continue;
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid);
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public PlayerMenuHandler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
if( item == 0 )
{
g_minutos_ban[ id ]++;
if( get_user_flags( id ) & ADMIN_IMMUNITY )
{
if( g_minutos_ban[ id ] > 7 )
g_minutos_ban[ id ] = 0;
}
else
{
if( g_minutos_ban[ id ] > 6 )
g_minutos_ban[ id ] = 0;
}
show_menu_players_bannear( id );
}
else
{
new iData[ 6 ], iName[ 64 ];
new access, callback;
menu_item_getinfo(menu, item, access, iData, 5, iName, 63, callback);
new iTarget = str_to_num( iData );
new iMinutos
if( is_user_connected( iTarget ) )
{
new Name[ 32 ];
get_user_name( iTarget, Name, charsmax( Name ) );
switch( g_minutos_ban[ id ] )
{
case 0: iMinutos = 5
case 1: iMinutos = 15
case 2: iMinutos = 30
case 3: iMinutos = 60
case 4: iMinutos = 180
case 5: iMinutos = 720
case 6: iMinutos = 1440
case 7: iMinutos = 99999999
}
hns_print_color( id, 0, "^x04[EasyBan]^x01 Estas por banear a^x03 %s^x01 durante^x03 %d^x01 minutos", Name, iMinutos );
g_id_ban[ id ] = iTarget;
client_cmd( id, "messagemode INTRODUCIR_RAZON" );
}
else hns_print_color( id, 0, "^x04[EasyBan]^x01 El jugador se desconecto. Utiliza el comando^x03 /banlast^x01" );
menu_destroy( menu );
}
return PLUGIN_HANDLED;
}
public introducir_razon( id )
{
read_args( g_razon_ban[ id ], charsmax( g_razon_ban[ ] ) );
remove_quotes( g_razon_ban[ id ] );
set_task( 0.1, "dar_ban_conectado", id+TASK_BAN_MENU )
}
public dar_ban_conectado( id )
{
id -= TASK_BAN_MENU
if( !( get_user_flags( id ) & ADMIN_KICK ) )
return PLUGIN_HANDLED;
new iMinutos
switch( g_minutos_ban[ id ] )
{
case 0: iMinutos = 5
case 1: iMinutos = 15
case 2: iMinutos = 30
case 3: iMinutos = 60
case 4: iMinutos = 180
case 5: iMinutos = 720
case 6: iMinutos = 1440
case 7: iMinutos = 999999
}
new minutos = get_systime( ) + iMinutos * 60;
new iMap[ 64 ], currentDate[ 15 ], tiempo, dias, horas, minutos2;
get_mapname( iMap, 31 );
get_time( "%Y-%m-%d", currentDate, 14 );
tiempo = minutos - get_systime( );
dias = ( tiempo / 86400 );
horas = ( ( tiempo % 86400 ) / 3600 );
minutos2 = ( ( ( tiempo % 86400 ) % 3600 ) / 60 );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBans (nuIdJugador, nuIdAdministrador, txRazon, nuTiempo, txMapa, txFechaBan, txServidor) VALUES ( '%d', '%d', '%s', '%d', '%s', '%s', '%s')",
g_id[ g_id_ban[ id ] ], g_id[ id ], g_razon_ban[ id ], minutos, iMap, currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBansHistorial (`nuIdJugador`, `nuIdAdministrador`, `nuTiempo`, `txRazon`, `txFecha`, `txServidor`) VALUES ( '%d', '%d', '%d', '%s', '%s', '%s' )",
g_id[ g_id_ban[ id ] ], g_id[ id ], minutos, g_razon_ban[ id ], currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
new iNombreBaneado[ 32 ], iNombreAdministrador[ 32 ];
get_user_name(id, iNombreAdministrador, 31);
get_user_name(g_id_ban[ id ], iNombreBaneado, 31);
hns_print_color( 0, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 fue baneado por el administrador^x03 %s", iNombreBaneado, iNombreAdministrador );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 Razon^x03 %s^x01 durante^x03 %d^x01 dias^x03 %d^x01 horas^x03 %d^x01 minutos", g_razon_ban[ id ], dias, horas, minutos2 );
consola_logs_data( g_id_ban[ id ] , dias, horas, minutos2, iMap, g_razon_ban[ id ], currentDate, iNombreBaneado, iNombreAdministrador, minutos, true );
return PLUGIN_HANDLED;
}
public consola_logs_data( id, dias, horas, minutos, const mapa[ ], const razon[ ], const fecha[ ], const nombreBaneado[ ], const nombreAdministrador[ ], tiempo, bool:logs )
{
if( id != 0 )
{
new address[ 32 ];
get_user_ip( id, address, 31, 1 );
client_print( id, print_console, " " );
client_print( id, print_console, " " );
client_print( id, print_console, "**************** [ ANOTHER LEVEL ] ****************^n^n" );
client_print( id, print_console, "* [ATENCION] Fuiste baneado | Datos del ban^n- Fecha: %s^n- Nombre: %s^n", fecha, nombreBaneado );
client_print( id, print_console, "- Administrador: %s^n", nombreAdministrador );
client_print( id, print_console, "- Razon: %s", razon );
client_print( id, print_console, "- Mapa: %s^n- Baneado hasta dentro de %d dias, %d horas, %d minutos^n", mapa, dias, horas, minutos );
client_print( id, print_console, "* Si crees que fuiste baneado injustamente visita el foro^n* Foro: www.anotherlevel.com.ar" );
client_print( id, print_console, "^n^n***************************************************" );
client_print( id, print_console, " " );
client_print( id, print_console, " " );
client_cmd( id, "setinfo _c_rate %s-%d", g_indentificador_sv, tiempo );
KickPlayer( id, "[EasyBan] Fuiste baneado, revisa tu consola" );
}
if( logs )
{
new data[ 300 ], iLen;
iLen += formatex( data[ iLen ], charsmax( data ) - iLen, "^n[EasyBan] ADMIN: %s | Jugador: %s - Razon: %s ( %d dias - %d horas - %d minutos)^nID En base datos: %d^n^nJugadores online^n", nombreAdministrador, nombreBaneado,
razon, dias, horas, minutos, g_id[ id ] );
new iNameLog[ 32 ];
for( new i = 0; i <= g_maxplayers; i++ )
{
if( !is_user_connected( i ) )
continue;
get_user_name( i, iNameLog, charsmax( iNameLog ) );
iLen += formatex( data[ iLen ], charsmax( data ) - iLen, "^n%d %s",i, iNameLog );
}
iLen += formatex( data[ iLen ], charsmax( data ) - iLen, "^n***************************************" );
log_to_file( "Bans.log", data );
}
return PLUGIN_HANDLED;
}
/* ============================================================== */
/* ================= [ BAN JUGADORES OFFLINE ] ================== */
/* ============================================================== */
public show_menu_players_bannear_last( id )
{
if( !( get_user_flags(id) & ADMIN_KICK ) )
return PLUGIN_HANDLED;
new menu = menu_create("\y[EasyBan]\w Ultimos desconectados", "PlayerMenuHandler_last");
static iMenu[ 406 ], iLen, szTempid[ 10 ];
iLen = 0;
iLen += formatex( iMenu[ iLen ], charsmax( iMenu ) - iLen, "\wBanear durante: \y%s^n^n", g_minutos_ban[ id ] == 0 ? "5 minutos" : g_minutos_ban[ id ] == 1 ? "15 minutos" : g_minutos_ban[ id ] == 2 ? "30 minutos" : g_minutos_ban[ id ] == 3 ? "1 hora" : g_minutos_ban[ id ] == 4 ? "3 horas" : g_minutos_ban[ id ] == 5 ? "12 horas" : g_minutos_ban[ id ] == 6 ? "1 Dia" : "Permamente" );
menu_additem( menu, iMenu );
for( new i = 0; i < g_last_players_desconectados; i++)
{
num_to_str( i, szTempid, 9);
menu_additem( menu, g_last_playername[ i ], szTempid );
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public PlayerMenuHandler_last(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
if( item == 0 )
{
g_minutos_ban[ id ]++;
if( get_user_flags( id ) & ADMIN_IMMUNITY )
{
if( g_minutos_ban[ id ] > 7 )
g_minutos_ban[ id ] = 0;
}
else
{
if( g_minutos_ban[ id ] > 6 )
g_minutos_ban[ id ] = 0;
}
show_menu_players_bannear_last( id );
}
else
{
new iData[ 6 ], iName[ 64 ];
new access, callback;
menu_item_getinfo(menu, item, access, iData,5, iName, 63, callback);
new iTarget = str_to_num( iData );
g_id_ban[ id ] = iTarget;
client_cmd( id, "messagemode INTRODUCIR_RAZON_BAN_LAST" );
menu_destroy( menu );
}
return PLUGIN_HANDLED;
}
public introducir_razon_ban_last( id )
{
read_args( g_razon_ban[ id ], charsmax( g_razon_ban[ ] ) );
remove_quotes( g_razon_ban[ id ] );
new iMinutos
switch( g_minutos_ban[ id ] )
{
case 0: iMinutos = 5
case 1: iMinutos = 15
case 2: iMinutos = 30
case 3: iMinutos = 60
case 4: iMinutos = 180
case 5: iMinutos = 720
case 6: iMinutos = 1440
case 7: iMinutos = 9999999
}
new minutos = get_systime( ) + iMinutos * 60;
new tiempo = minutos - get_systime( );
new dias = ( tiempo / 86400 );
new horas = ( ( tiempo % 86400 ) / 3600 );
new minutos2 = ( ( ( tiempo % 86400 ) % 3600 ) / 60 );
new iMap[ 64 ];
get_mapname( iMap, 31 );
new currentDate[ 15 ];
get_time( "%Y-%m-%d", currentDate, 14 );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBans (nuIdJugador, nuIdAdministrador, txRazon, nuTiempo, txMapa, txFechaBan, txServidor) VALUES ( '%d', '%d', '%s', '%d', '%s', '%s', '%s')",
g_last_id[ g_id_ban[ id ] ], g_id[ id ], g_razon_ban[ id ], minutos, iMap, currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBansHistorial (`nuIdJugador`, `nuIdAdministrador`, `nuTiempo`, `txRazon`, `txFecha`, `txServidor`) VALUES ( '%d', '%d', '%d', '%s', '%s', '%s' )",
g_last_id[ g_id_ban[ id ] ], g_id[ id ], minutos, g_razon_ban[ id ], currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
new iNombreAdministrador[ 32 ];
get_user_name(id, iNombreAdministrador, 31);
consola_logs_data( 0, dias, horas, minutos2, iMap, g_razon_ban[ id ], currentDate, g_last_playername[ g_id_ban[ id ] ], iNombreAdministrador, tiempo, true )
hns_print_color( 0, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 fue baneado por el administrador^x03 %s", g_last_playername[ g_id_ban[ id ] ], iNombreAdministrador );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 Razon^x03 %s^x01 durante^x03 %d^x01 dias^x03 %d^x01 horas^x03 %d^x01 minutos", g_razon_ban[ id ], dias, horas, minutos2 );
}
/* ============================================================== */
/* ================== [ DESBANEAR JUGADORES ] =================== */
/* ============================================================== */
public clcmd_unban( id )
{
if( get_user_flags( id ) & ADMIN_IMMUNITY )
{
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = 0
formatex( szQuery, charsmax( szQuery ), "SELECT id, (SELECT txNombre FROM tJugadores WHERE id = tBans.nuIdJugador) AS NombreBaneado, txServidor FROM tBans WHERE nuTiempo > '1'" );
SQL_ThreadQuery( g_hTuple, "menu_unban", szQuery, iData, 2 );
}
else if( get_user_flags( id ) & ADMIN_KICK )
{
new szQuery[ 256 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = 0
formatex( szQuery, charsmax( szQuery ), "SELECT id, (SELECT txNombre FROM tJugadores WHERE id = tBans.nuIdJugador) AS NombreBaneado, txServidor FROM tBans WHERE nuTiempo > '1' AND txServidor='%s'", g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "menu_unban", szQuery, iData, 2 );
}
else hns_print_color( id, 0, "^x04[EasyBan]^x01 No tiene acceso")
return PLUGIN_CONTINUE;
}
public menu_unban( iFailState, Handle:iQuery, szError[ ], iError, iData[ ], iDataSize, Float:fQueueTime )
{
if( iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED )
{
log_amx( "%s", szError );
return;
}
else
{
new id = iData[ 0 ];
switch( iData[ 1 ] )
{
case 0:
{
if( SQL_NumResults( iQuery ) )
{
new szNombreBaneado[ 32 ], txServidorBaneado[ 26 ], nuIdBan;
static szBuffer[ 2368 ], szIdJugador[ 10 ];
new menu = menu_create( "\y[EasyBan]\w Jugadores baneados: ", "handle_baneados")
while( SQL_MoreResults( iQuery ) )
{
nuIdBan = SQL_ReadResult( iQuery, 0 );
SQL_ReadResult( iQuery, 1, szNombreBaneado, charsmax( szNombreBaneado ) );
SQL_ReadResult( iQuery, 2, txServidorBaneado, charsmax( txServidorBaneado ) );
format( szBuffer, charsmax( szBuffer ), "%s\y (%s)", szNombreBaneado, txServidorBaneado )
num_to_str( nuIdBan, szIdJugador, 9);
menu_additem( menu, szBuffer, szIdJugador )
SQL_NextRow( iQuery )
}
menu_setprop( menu, MPROP_BACKNAME,"\yAtras" )
menu_setprop( menu, MPROP_NEXTNAME,"\ysiguiente" )
menu_setprop( menu, MPROP_EXITNAME,"\ySalir" )
menu_display( id, menu , 0 )
}
SQL_FreeHandle( iQuery );
}
case 1:
{
if( SQL_NumResults( iQuery ) )
{
new szNombreBaneado[ 32 ], szNombreAdministrador[ 32 ], txRazon[ 32 ], txMapa[ 26 ], TiempoDB, idBanDb, txFechaBan[ 12 ], szBuffer[ 800 ], iLen;
SQL_ReadResult( iQuery, 0, szNombreBaneado, charsmax( szNombreBaneado ) );
SQL_ReadResult( iQuery, 1, szNombreAdministrador, charsmax( szNombreAdministrador ) );
SQL_ReadResult( iQuery, 2, txRazon, charsmax( txRazon ) );
SQL_ReadResult( iQuery, 3, txMapa, charsmax( txMapa ) )
TiempoDB = SQL_ReadResult( iQuery, 4 );
SQL_ReadResult( iQuery, 5, txFechaBan, charsmax( txFechaBan ) )
idBanDb = SQL_ReadResult( iQuery, 6 );
idJugadorBan[ id ] = SQL_ReadResult( iQuery, 7 );
idBan[ id ] = idBanDb;
new tiempo = TiempoDB - get_systime( );
new dias = ( tiempo / 86400 );
new horas = ( ( tiempo % 86400 ) / 3600 );
new minutos = ( ( ( tiempo % 86400 ) % 3600 ) / 60 );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\y[EasyBan]\w Baneados:^n^n" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "Jugador:\y %s\w^nTiempo baneado:\y %d\w Dias |\y %d\w Horas |\y %d\w Minutos^n^n\wAdmin:\y %s^n\wRazon:\y %s^n\wMapa: \y%s^n\wFecha del ban: \y%s"
, szNombreBaneado, dias, horas, minutos, szNombreAdministrador, txRazon, txMapa, txFechaBan );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "^n^n\r1.\w Desbanear" );
if( get_user_flags( id ) & ADMIN_KICK )
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "^n\r2.\w Nuevo tiempo" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "^n\r0.\w Salir " );
show_menu( id, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9), szBuffer, _, "Menu_UnBanJugador" );// register_menu( "Menu_UnBanJugador", KEYSMENU, "Menu_UnBanJugadorHandler")
}
else hns_print_color( id, 0, "ERRORRRR" );
}
}
}
}
public Menu_UnBanJugadorHandler(id , key)
{
switch( key )
{
case 0:
{
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = UNBAN_PLAYER;
formatex( szQuery, charsmax( szQuery ), "SELECT nuTiempo, id, (SELECT txNombre FROM tJugadores WHERE id = tBans.nuIdJugador) FROM tBans where id = '%d'", idBan[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
}
case 1: client_cmd( id, "messagemode INTRODUCIR_MINUTOS" );
}
return PLUGIN_HANDLED;
}
public handle_baneados(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new iData[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, iData,5, iName, 63, callback);
new idBaneado = str_to_num( iData );
new szQuery[ 512 ], iData2[ 2 ];
iData2[ 0 ] = id;
iData2[ 1 ] = 1;
formatex( szQuery, charsmax( szQuery ), "SELECT (SELECT txNombre FROM tJugadores where id = tBans.nuIdJugador) as NombreBaneado, (SELECT txNombre FROM tJugadores where id = tBans.nuIdAdministrador) as NombreAdministrador, txRazon, txMapa, nuTiempo, txFechaBan, id, nuIdJugador FROM tBans where id = '%d'", idBaneado );
SQL_ThreadQuery( g_hTuple, "menu_unban", szQuery, iData2, 2 );
return PLUGIN_HANDLED;
}
public introducir_minutos( id )
{
new iMinutos[ 6 ];
read_args( iMinutos, charsmax( iMinutos ) );
remove_quotes( iMinutos );
new minutos = get_systime( ) + str_to_num( iMinutos ) * 60;
new currentDate[ 15 ];
get_time( "%Y-%m-%d", currentDate, 14 );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "UPDATE tBans SET nuTiempo='%d' WHERE id=^"%d^"", minutos, idBan[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBansHistorial (`nuIdJugador`, `nuIdAdministrador`, `nuTiempo`, `txRazon`, `txFecha`, `txServidor`) VALUES ( '%d', '%d', '%d', 'CAMBIO TIEMPO DE BAN', '%s', '%s' )",
idJugadorBan[ id ], g_id[ id ], minutos, currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
}
public client_connect( id )
{
g_hid[ id ][ 0 ] = '^0';
set_task( 2.0, "test_hid", id+TASK_TAKEHID, _, _, "b" );
}
public client_disconnect( id )
{
new Name[ 32 ];
get_user_name( id, Name, charsmax( Name ) );
/* ==== [ PARA BAN LAST ] ==== */
copy( g_last_playername[ g_last_players_desconectados ], charsmax( g_last_playername[ ] ), Name );
g_last_id[ g_last_players_desconectados ] = g_id[ id ];
g_last_players_desconectados++
/* ==== [ PARA BAN LAST ] ==== */
new iTiempoTotal = get_systime( ) - g_tiempo_jugador[ id ];
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "UPDATE tJugadores SET txNombre=^"%s^", nuTiempoOnline='%d' WHERE id=^"%d^"", Name, iTiempoTotal, g_id[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
remove_task( id+TASK_TAKEHID );
g_id[ id ] = 0;
g_setinfo[ id ][ 0 ] = '^0';
g_errores_setinfo[ id ] = 0;
}
public test_hid( id )
{
id -= TASK_TAKEHID;
server_cmd( "sxe_userhid #%d", get_user_userid( id ) );
server_exec( );
get_pcvar_string( cvar_output, g_hid[ id ], charsmax( g_hid[ ] ) );
if( strlen( g_hid[ id ] ) >= 27 )
{
new hidSetinfo[ 20 ];
get_user_info( id, "*HID", hidSetinfo, 19 );
new iGetip[ 32 ];
get_user_ip( id, iGetip, charsmax( iGetip ) );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = CHEQUEAR_ESTADO;
formatex( szQuery, charsmax( szQuery ), "SELECT id FROM tJugadores WHERE txHid=^"%s^" OR txHidSetinfo='%s' OR txIp='%s'", g_hid[ id ], hidSetinfo, iGetip );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
iData[ 0 ] = id;
iData[ 1 ] = CHEQUEAR_ADMIN;
formatex( szQuery, charsmax( szQuery ), "SELECT nombreJuego, setinfo, flags, servidorFVencimiento1, servidorFVencimiento2, servidorFVencimiento3, servidorFVencimiento4, servidorFVencimiento5, servidorFVencimiento6, servidorFVencimiento7, estadoAdmin FROM tAdmines WHERE hid='%s'", g_hid[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
remove_task( id+TASK_TAKEHID )
}
}
public ClientUserInfoChanged(id, buffer)
{
static const name[ ] = "name";
static szOldName[ 32 ], szNewName[ 32 ];
pev( id, pev_netname, szOldName, charsmax( szOldName ) );
if( szOldName[ 0 ] )
{
get_user_info( id, name, szNewName, charsmax( szNewName ) );
if( strlen(szNewName) < 3 )
{
return FMRES_HANDLED;
}
if( !equal(szOldName, szNewName) )
{
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "UPDATE tJugadores SET txNombre=^"%s^" WHERE id=^"%d^"", szNewName, g_id[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
}
}
return PLUGIN_CONTINUE;
}
public chequear_ban_setinfo( id )
{
new servidor[ 2 ];
new tiempo[ 15 ];
new data[ 100 ];
get_user_info( id, "_c_rate", data, 99 );
strtok( data, servidor, 1, tiempo, 14, '-' );
if( !equal( servidor, g_indentificador_sv ) )
return;
if( str_to_num( tiempo ) > get_systime( ) )
{
new iMap[ 64 ];
get_mapname( iMap, 31 );
new currentDate[ 15 ];
get_time( "%Y-%m-%d", currentDate, 14 );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tBans (nuIdJugador, nuIdAdministrador, txRazon, nuTiempo, txMapa, txFechaBan, txServidor) VALUES ( '%d', '1', 'Sacarse el BAN', '%d', '%s', '%s', '%s')",
g_id[ id ], str_to_num( tiempo ) , iMap, currentDate, g_indentificador_sv );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
}
}
public DataHandler( failstate, Handle:Query, error[ ], error2, data[ ], datasize, Float:time )
{
static id;
id = data[ 0 ];
switch( failstate ) {
case TQUERY_CONNECT_FAILED: {
log_to_file( "SQL_LOG_TQ.txt", "Error en la conexion al MySQL [%i]: %s", error2, error );
return;
}
case TQUERY_QUERY_FAILED:
log_to_file( "SQL_LOG_TQ.txt", "Error en la consulta al MySQL [%i]: %s", error2, error );
}
switch( data[ 1 ] )
{
case GUARDAR_DATOS:
{
if( failstate != TQUERY_SUCCESS )
client_print( id, print_console, "[EasyBan] Error, mal estrucutrado el sistema, o el jugador no esta en nuestra base de datos" )
else
client_print( id, print_console, "[EasyBan] El ban fue dado/removido exitosamente" );
}
case INGRESO_NUEVO_JUGADOR:
{
static Name[ 32 ];
get_user_name( id, Name, charsmax( Name ) );
g_id[ id ] = SQL_ReadResult( Query, 0 );
hns_print_color( 0, 0, "^x04[AL]^x01 Demosle la bienvenida al jugador^x03 %s^x01 a nuestra comunidad", Name );
chequear_ban_setinfo( id );
}
case UNBAN_PLAYER:
{
if( SQL_NumResults( Query ) )
{
new iTiempoBaneado, idBan, szNombreBaneado[ 32 ];
iTiempoBaneado = SQL_ReadResult( Query, 0 );
idBan = SQL_ReadResult( Query, 1 );
SQL_ReadResult( Query, 2, szNombreBaneado, charsmax( szNombreBaneado ) );
if( iTiempoBaneado > 0 )
{
static Name[ 32 ];
get_user_name( id, Name, charsmax( Name ) );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "DELETE FROM `tBans` WHERE id = '%d'", idBan );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 fue desbaneado por el administrador^x03 %s", szNombreBaneado, Name );
}
else hns_print_color( id, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 no esta baneado", szNombreBaneado );
}
else
{
hns_print_color( id, 0, "^x04[EasyBan]^x01 El jugador no fue encontrado" );
client_print( id, print_console, "[EasyBan] El jugador no fue encontrado" );
}
}
case CHEQUEAR_ESTADO:
{
new hidSetinfo[ 20 ];
get_user_info( id, "*HID", hidSetinfo, 19 );
new iGetip[ 32 ];
get_user_ip( id, iGetip, charsmax( iGetip ) );
static Name[ 32 ];
get_user_name( id, Name, charsmax( Name ) );
new currentDate[ 15 ];
get_time( "%Y-%m-%d", currentDate, 14 );
g_tiempo_jugador[ id ] = get_systime( );
if( SQL_NumResults( Query ) )
{
g_id[ id ] = SQL_ReadResult( Query, 0 );
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "UPDATE tJugadores SET txHid='%s', txHidSetinfo='%s', txIp='%s', txNombre='%s', txUltimoIngreso='%s' WHERE id='%d'", g_hid[ id ], hidSetinfo, iGetip, Name, currentDate, g_id[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
iData[ 0 ] = id;
iData[ 1 ] = CHEQUEAR_BAN;
formatex( szQuery, charsmax( szQuery ), "SELECT *, (SELECT txNombre FROM tJugadores WHERE tBans.nuIdJugador = id), (SELECT txNombre FROM tJugadores WHERE tBans.nuIdAdministrador = id) FROM tBans WHERE nuIdJugador = '%d'", g_id[ id ] );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
}
else
{
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "INSERT INTO tJugadores (txNombre, txHid, txHidSetinfo, txIp, txFechaIngreso, txUltimoIngreso) VALUES ('%s', '%s', '%s', '%s', '%s', '%s' )", Name, g_hid[ id ], hidSetinfo, iGetip, currentDate, currentDate );
SQL_ThreadQuery(g_hTuple, "DataHandler", szQuery, iData, 2);
iData[ 0 ] = id;
iData[ 1 ] = INGRESO_NUEVO_JUGADOR;
formatex( szQuery, charsmax( szQuery ), "SELECT id FROM tJugadores ORDER BY id DESC LIMIT 1" );
SQL_ThreadQuery(g_hTuple, "DataHandler", szQuery, iData, 2);
}
}
case CHEQUEAR_BAN:
{
if( SQL_NumResults( Query ) )
{
while( SQL_MoreResults( Query ) )
{
new idDb, razon[ 200 ], tiempo, mapa[ 26 ], servidor[ 26 ], fechaBan[ 16 ], iNombreBaneado[ 32 ], iNombreAdministrador[ 32 ];
idDb = SQL_ReadResult( Query, 0 );
SQL_ReadResult( Query, 3, razon, charsmax( razon ) );
tiempo = SQL_ReadResult( Query, 4 );
SQL_ReadResult( Query, 5, mapa, charsmax( mapa ) );
SQL_ReadResult( Query, 6, servidor, charsmax( servidor ) );
SQL_ReadResult( Query, 7, fechaBan, charsmax( fechaBan ) );
SQL_ReadResult( Query, 8, iNombreBaneado, charsmax( iNombreBaneado ) );
SQL_ReadResult( Query, 9, iNombreAdministrador, charsmax( iNombreAdministrador ) );
if( equal( servidor, g_indentificador_sv ) )
{
if( tiempo > get_systime( ) )
{
new tiempo2 = tiempo - get_systime( );
new dias = ( tiempo2 / 86400 );
new horas = ( ( tiempo2 % 86400 ) / 3600 );
new minutos = ( ( ( tiempo2 % 86400 ) % 3600 ) / 60 );
consola_logs_data( id, dias, horas, minutos, mapa, razon, fechaBan, iNombreBaneado, iNombreAdministrador, tiempo, false );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 quiere ingresar al servidor pero esta baneado", iNombreBaneado );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 La razon por la cual fue baneado:^x03 %s", razon );
}
else
{
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = id;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "DELETE FROM `tBans` WHERE id = '%d'", idDb );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
hns_print_color( 0, 0, "^x04[EasyBan]^x01 El jugador^x03 %s^x01 fue desbaneado tras cumplir su condena", iNombreBaneado );
}
}
SQL_NextRow( Query )
}
}
SQL_FreeHandle( Query );
}
/* Si llego aca es por que coincide tag o hid */
case CHEQUEAR_ADMIN:
{
if( SQL_NumResults( Query ) )
{
new iFlags[ 30 ], iSetinfo[ 25 ], iNombre[ 33 ], estadoAdmin;
SQL_ReadResult( Query, 0, g_nombre_admin[ id ], charsmax( g_nombre_admin[ ] ) );
SQL_ReadResult( Query, 1, g_setinfo[ id ], charsmax( g_setinfo[ ] ) );
SQL_ReadResult( Query, 2, g_flags_admin[ id ], charsmax( g_flags_admin[ ] ) );
SQL_ReadResult( Query, 3, g_fechaVencimientoAdmin[ id ][ 0 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 4, g_fechaVencimientoAdmin[ id ][ 1 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 5, g_fechaVencimientoAdmin[ id ][ 2 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 6, g_fechaVencimientoAdmin[ id ][ 3 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 7, g_fechaVencimientoAdmin[ id ][ 4 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 8, g_fechaVencimientoAdmin[ id ][ 5 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
SQL_ReadResult( Query, 9, g_fechaVencimientoAdmin[ id ][ 6 ], charsmax( g_fechaVencimientoAdmin[ ][ ] ) );
estadoAdmin = SQL_ReadResult( Query, 10 );
new setinfoJugador[ 25 ];
get_user_info( id, "_pw", setinfoJugador, 24 );
new currentDate[ 15 ];
get_time( "%Y-%m-%d", currentDate, 14 );
new address[ 32 ];
get_user_ip( id, address, 31, 1 );
if( estadoAdmin != 5 )
return
switch( g_indentificador_sv[ 0 ] )
{
case 'a':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 0 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 0 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'b':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 1 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 1 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'c':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 2 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 2 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'd':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 3 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 3 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'e':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 4 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 4 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'f':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 5 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 5 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
case 'g':
{
if( !( equal( g_fechaVencimientoAdmin[ id ][ 6 ], "0000-00-00" ) ) )
{
hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Bienvenido^x03 %s^x01 tu administrador seguira activo hasta el^x03 %s^x01 gracias por elegirnos", g_nombre_admin[ id ], g_fechaVencimientoAdmin[ id ][ 6 ] )
remove_user_flags(id, -1);
set_user_flags(id, read_flags( g_flags_admin[ id ] ) )
}
}
}
}
}
}
}
public clcmd_vencimiento_admin( id )
{
switch( g_indentificador_sv[ 0 ] )
{
case 'a': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 0 ] )
case 'b': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 1 ] )
case 'c': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 2 ] )
case 'd': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 3 ] )
case 'e': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 4 ] )
case 'f': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 5 ] )
case 'g': hns_print_color( id, 0, "^x04[EasyAdmin]^x01 Tu administrador vence el^x03 %s^x01 para renovar www.anotherlevel.com.ar", g_fechaVencimientoAdmin[ id ][ 6 ] )
}
}
public MySQLx_Init( )
{
g_hTuple = SQL_MakeDbTuple( MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DATEBASE );
if( !g_hTuple )
{
log_to_file( "SQL_ERROR.txt", "No se pudo conectar con la base de datos." );
return pause( "a" );
}
new szQuery[ 1024 ], iData[ 2 ];
iData[ 0 ] = 0;
iData[ 1 ] = GUARDAR_DATOS;
formatex( szQuery, charsmax( szQuery ), "DELETE FROM `tBans` WHERE nuTiempo < '%d'", get_systime( ) );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "DELETE FROM tAdmines WHERE servidorFVencimiento1 < NOW() AND servidorFVencimiento1 != '0000-00-00'" );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "DELETE FROM tAdmines WHERE servidorFVencimiento2 < NOW() AND servidorFVencimiento2 != '0000-00-00'" );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "DELETE FROM tAdmines WHERE servidorFVencimiento3 < NOW() AND servidorFVencimiento3 != '0000-00-00'" );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "DELETE FROM tAdmines WHERE servidorFVencimiento4 < NOW() AND servidorFVencimiento4 != '0000-00-00'" );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
formatex( szQuery, charsmax( szQuery ), "DELETE FROM tAdmines WHERE servidorFVencimiento5 < NOW() AND servidorFVencimiento5 != '0000-00-00'" );
SQL_ThreadQuery( g_hTuple, "DataHandler", szQuery, iData, 2 );
return PLUGIN_CONTINUE;
}
public plugin_end( )
SQL_FreeHandle( g_hTuple );
stock KickPlayer( id, const Reason[] )
{
emessage_begin( MSG_ONE, SVC_DISCONNECT, _, id );
ewrite_string( Reason );
emessage_end();
}