SA-MP Forums Archive
Ayuda registro MySql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda registro MySql (/showthread.php?tid=534694)



Ayuda registro MySql - CoR3 - 30.08.2014

Bueno, lo que pasa es que el server deja pasar a cualquier persona, y no verifica si la calve es correcta; de ese modo cualquier persona podrб ingresar a la cuenta de quien quiera con solo ponerse el Nick

Acб esta los cуdigos del Login
Quote:

stock OnPlayerLogin(playerid,password[])
{
new query[512];
format(query,sizeof(query),"SELECT * FROM `Jugadores` WHERE `Nombre` = '%s' LIMIT 1",GN(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row(query) == 1)
{
MySQLGetString("Nombre",PlayerInfo[playerid][pNickName]);
MySQLGetString("Contraseсa",PlayerInfo[playerid][pKey]);//
MySQLGetInt("Dinero",PlayerInfo[playerid][pMoney]);//
MySQLGetInt("Score",PlayerInfo[playerid][pScore]);//
mysql_free_result();

if(strcmp(PlayerInfo[playerid][pKey], password, true, 20) == 0)
{
new PLAYERIP[16];
GetPlayerIp(playerid, PLAYERIP, sizeof PLAYERIP);
gPlayerLogged[playerid] = 1;
GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]);
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
}
else
{
gPlayerLogged[playerid] = 0;
}
}
return 1;
}