06.06.2014, 22:54
pawn Код:
strcat(Query,"INSERT INTO `banidos`(ban_motivo,Ban_Dia,Ban_Mes,Ban_Ano,Desban_Dia,Desban_Mes,Desban_Ano,Ban_Hora,Ban_Minuto,Ban_Segundo,Desban_Hora,Desban_Minuto,Desban_Segundo,user_admin)");
strcat(Query," VALUES ('%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')");
mysql_format(MySQL, Query,sizeof(Query),Query, motivo,Dia, Mes, Ano, DesbanDia, DesbanMes, DesbanAno, Hora, Minuto, Segundo, DesbanHora, DesbanMinuto, DesbanSegundo, Admin);
mysql_query(MySQL,Query,false);
Код HTML:
[20:10:55] [ERROR] CMySQLQuery::Execute - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `banidos`(ban_motivo,Ban_Dia,Ban_Mes,Ban_Ano,Desban_Dia,Desban_Mes,D' at line 1 [20:13:44] [ERROR] CMySQLQuery::Execute - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `banidos`(ban_motivo,Ban_Dia,Ban_Mes,Ban_Ano,Desban_Dia,Desban_Mes,D' at line 1
pawn Код:
stock MySQL_BanIP(playerid, Admin[], motivo[], DesbanDia = 0, DesbanMes = 0, DesbanAno = 0, DesbanHora = 0, DesbanMinuto = 0, DesbanSegundo = 0)
{
if(ConfirmarConta(PlayerName(playerid)))
{
new Query[800], Rows, Fields; GetPlayerIp(playerid, IpPlayer, sizeof(IpPlayer)); getdate(Ano, Mes, Dia); gettime(Hora, Minuto, Segundo);
mysql_format(MySQL,Query, sizeof(Query), "SELECT * FROM `banidos` WHERE `ip_ban`='%s'", IpPlayer);
mysql_query(MySQL,Query);
cache_get_data(Rows, Fields);
if(Rows)
{
strcat(Query,"UPDATE `banidos` SET `ban_motivo`='%s', `Ban_Dia`='%d', `Ban_Mes`='%d', `Ban_Ano`='%d', `Desban_Dia`='%d', `Desban_Mes`='%d', `Desban_Ano`='%d'");
strcat(Query,", `Ban_Hora`='%d', `Ban_Minuto`='%d', `Ban_Segundo`='%d', `Desban_Hora`='%d', `Desban_Minuto`='%d', `Desban_Segundo`='%d', `user_admin`='%s'");
cache_get_field_content(0, "Desban_Dia", string); DesbanDia = DesbanDia+strval(string);
cache_get_field_content(0, "Desban_Hora", string); DesbanHora = DesbanHora+strval(string);
cache_get_field_content(0, "Desban_Mes", string); DesbanMes = DesbanMes+strval(string);
cache_get_field_content(0, "Desban_Minuto", string); DesbanMinuto = DesbanMinuto+strval(string);
cache_get_field_content(0, "Desban_Ano", string); DesbanAno = DesbanAno+strval(string);
cache_get_field_content(0, "Desban_Segundo", string); DesbanSegundo = DesbanSegundo+strval(string);
mysql_format(MySQL, Query,sizeof(Query),Query, strlen(motivo),Dia, Mes, Ano, DesbanDia, DesbanMes, DesbanAno, Hora, Minuto, Segundo, DesbanHora, DesbanMinuto, DesbanSegundo, Admin);
mysql_query(MySQL,Query,false);
SetTimerEx("kickplayer", 100, false, "i", playerid);
return 1;
}
else if(!Rows)
{
strcat(Query,"INSERT INTO `banidos`(ban_motivo,Ban_Dia,Ban_Mes,Ban_Ano,Desban_Dia,Desban_Mes,Desban_Ano,Ban_Hora,Ban_Minuto,Ban_Segundo,Desban_Hora,Desban_Minuto,Desban_Segundo,user_admin)");
strcat(Query," VALUES ('%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')");
mysql_format(MySQL, Query,sizeof(Query),Query, motivo,Dia, Mes, Ano, DesbanDia, DesbanMes, DesbanAno, Hora, Minuto, Segundo, DesbanHora, DesbanMinuto, DesbanSegundo, Admin);
mysql_query(MySQL,Query,false);
SetTimerEx("kickplayer", 100, false, "i", playerid);
return 1;
}
}
return 1;
}