new Query[130]; mysql_format(MySQL, Query, sizeof Query, "SELECT SQLID, Password, Salt FROM cuentas WHERE Usuario = '%e' LIMIT 1", NombreJugador(playerid)); mysql_tquery(MySQL, Query, "LogueoUsuario", "i", playerid);
new rows, fields;
cache_get_data(rows, fields);
if(rows == 1){CuentaExiste[playerid] = 1;}
else if(!rows){CuentaExiste[playerid] = 0;}
if(clickedid == TextdrawsGlobales[3])
{
QuitarMenuInicio(playerid), CancelSelectTextDraw(playerid);
if(CuentaExiste[playerid] == 0)
{
cache_get_field_content(0, "Password", InformacionJugador_[playerid][pPassword], MySQL, 65);
cache_get_field_content(0, "Salt", InformacionJugador_[playerid][pSalt], MySQL, 11);
new string[150];
format(string, sizeof(string), ""#CBLANCO"Bienvenido(a) "#CGRIS_3"%s.\n\n"#CBLANCO"Tu cuenta no estб registrada en nuestra base de datos, Ingresa una contraseсa:", NombreJugador(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, ""CAZUL"Registro - ", string, "Registrar","Cancelar");
return 1;
}
else if(CuentaExiste[playerid] == 1)
{
MostrarMenuInicio(playerid);
return 1;
}
}
else if(clickedid == TextdrawsGlobales[4])
{
QuitarMenuInicio(playerid), CancelSelectTextDraw(playerid);
if(CuentaExiste[playerid] == 0)
{
MostrarMenuInicio(playerid);
return 1;
}
else if(CuentaExiste[playerid] == 1)
{
new string[145];
format(string, sizeof(string), ""#CBLANCO"Bienvenido(a) "#CGRIS_3"%s\n\n"#CBLANCO"Tu cuenta estб registrada en nuestra base de datos, Ingresa su contraseсa:", NombreJugador(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""CAZUL"Login - ", string, "Ingresar","Cancelar");
return 1;
}
}
CALLBACK: LogueoUsuario(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows == 1){CuentaExiste[playerid] = 1;}
else if(!rows){CuentaExiste[playerid] = 0;}
if(IsRolePlayName(playerid))
{
MostrarMenuInicio(playerid), LimpiarPantalla(playerid, 50);
TextDrawShowForPlayer(playerid, TextdrawsGlobales[14]), TextDrawShowForPlayer(playerid, TextdrawsGlobales[15]);
TextDrawShowForPlayer(playerid, TextdrawsGlobales[16]), TextDrawShowForPlayer(playerid, TextdrawsGlobales[17]);
new string[30];
format(string, sizeof(string), "%d usuario(s) conectado(s)", Iter_Count(Player));
TextDrawSetString(TextdrawsGlobales[17], string);
SendClientMessage(playerid, COLOR_PIEL, "");
SendClientMessage(playerid, COLOR_PIEL, "");
SendClientMessage(playerid, COLOR_PIEL, "* Informaciуn: Tienes 5 minutos para Ingresar/Registrar una cuenta en el servidor o serбs expulsado.");
SendClientMessage(playerid, COLOR_PIEL, "");
SendClientMessage(playerid, COLOR_PIEL, "");
LogueoTiempo[playerid] = SetTimerEx("KickTimer", 50000, 0, "d", playerid);
SetPlayerPos(playerid, 2096.8398,-1879.4764,15.000), SetPlayerCameraPos(playerid, 2096.8398,-1879.4764,30), SetPlayerCameraLookAt(playerid, 2080.5161,-1759.1907,13.5656);
}
else
{
LimpiarPantalla(playerid, 50);
SendClientMessage(playerid, COLOR_PIEL, "Para jugar en este servidor con la modalidad RolePlayes es requerido que utilice el formato nickname Nombre_Apellido. ");
SendClientMessage(playerid, COLOR_PIEL, "Debe usar un guiуn bajo (_) entre nombre y apellido.");
SendClientMessage(playerid, COLOR_PIEL, "Ejemplo: Antonio Rincon, Jorge Fernandez.");
SetTimerEx("KickTimer", 500, false, "d", playerid);
}
return 1;
}
|
new Query[130]; mysql_format(MySQL, Query, sizeof Query, "SELECT SQLID, Password, Salt FROM `cuentas` WHERE Usuario = '%e' LIMIT 1", NombreJugador(playerid)); mysql_tquery(MySQL, Query, "LogueoUsuario", "i", playerid); |
|
En vez de usar "CuentaExiste[playerid] = 0" usa "CuentaExiste[playerid] = 1" y la que usas 1 dale a 2.
|
|
Era eso ahora funciona a la perfecciуn +REP muchнsimas gracias.
|