Necesito ayuda con a_mysql.
#4

pawn Код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], solicitud[254];
GetPlayerName(playerid, name, sizeof(name));
format(solicitud, sizeof(solicitud), "SELECT IP FROM `usuarios` WHERE user = '%s' LIMIT 1",name);
mysql_query(mysql, solicitud);
if(cache_warning_count()) //Segъn he visto con esto podemos saber si existe..
{
new string[244];
format(string, sizeof(string), "Tъ cuenta existe, IP: %d"); //Esto lo pondrй mбs adelante.
SendClientMessage(playerid, -1, string);
print("ESTA CUENTA EXISTE DE VERDAD.");
}
else {
SendClientMessage(playerid, -1, "Tъ cuenta se ha registrado a la base de datos");
format(solicitud, sizeof(solicitud), "INSERT INTO `usuarios` (`Usuario`, `Password`, `IP`, `Rango`, `Premium`, `Dinero`, `PosX` ,`PosY`, `PosZ`) VALUES ('%s', 'test', 'test', 0, 0, 0, 0.0, 0.0, 0.0)",name);
mysql_query(mysql, solicitud);
}
}
Sigue sin detectarme si la cuenta existe y se siguen creando a pesar de existir.
Reply


Messages In This Thread
Necesito ayuda con a_mysql. - by xHanks - 14.11.2014, 15:01
Respuesta: Necesito ayuda con a_mysql. - by hotspicytaco - 14.11.2014, 21:06
Re: Necesito ayuda con a_mysql. - by Mr.GeEk - 15.11.2014, 02:25
Respuesta: Necesito ayuda con a_mysql. - by xHanks - 15.11.2014, 08:39

Forum Jump:


Users browsing this thread: 1 Guest(s)