Mysql login error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql login error (
/showthread.php?tid=603270)
Mysql login error -
Infernux - 20.03.2016
Hello there! I have my database in a remote connection, but a little time after running the server, when I enter to the server, the login dialog doesn't appear
Can someone help me? I use mysql r39-4, mysql_static version
Thx
Re: Mysql login error -
Kaperstone - 20.03.2016
kthen, it doesn't appear.
If I was a player I could figure it out, but if I was a scripter/programmer, I'd need something more than words to work with.
Lets say, log ? code ?
Re: Mysql login error -
Infernux - 20.03.2016
Sorry, here is the code:
pawn Код:
public OnPlayerConnect(playerid)
{
new query[128];
mysql_format(mysql, query, sizeof(query),"SELECT `Clave`, `ID` FROM `jugadores` WHERE `Usuario` = '%e' LIMIT 1", NombreOOC(playerid));
mysql_pquery(mysql, query, "Loguear", "i", playerid);
return true;
}
pawn Код:
forward Loguear(playerid);
public Loguear(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
LimpiarChat(playerid);
if(rows)
{
cache_get_field_content(0, "Clave", Jugador[playerid][Clave], mysql, 128);
Jugador[playerid][ID] = cache_get_field_content_int(0, "ID");
Dialogo(playerid, Dialogo_Ingreso, PASSWORD, "> Ingresar", ""CBlanco"Bienvenido de nuevo a {FFFF00}"dato_nombre""CBlanco".\n\nPor favor, inicia sesiуn escribiendo tu contraseсa:", "Ingresar", "Salir");
}
else
{
if(!EsNombreValido(playerid)){
MensajeError(playerid, "Usted ha sido expulsado automбticamente del servidor. Razуn: Utilizar un nombre incorrecto y/o errуneo.");
Mensaje(playerid, Color_Blanco, "Visite "dato_web" para obtener mбs informaciуn y ver guнas del juego.");
return Expulsar(playerid);
}
else
{
return Dialogo(playerid, Dialogo_Registro, PASSWORD, "> Registrarse", ""CBlanco"Bienvenido a {FFFF00}"dato_nombre""CBlanco".\n\nPor favor, registra tu cuenta escribiendo una contraseсa:", "Registrar", "Salir");
}
}
return true;
}