Help, registration sistem.
#1

The server does not check if the key is correct and let everyone enter any account.

I think that the problem is here:

Quote:

stock LoginCheck(playerid)
{
new string[256];
if(gPlayerLogged[playerid] != 1)
{
new query[256];
format(query,sizeof(query),"SELECT * FROM `Jugadores` WHERE `Nombre` = '%s' LIMIT 1", GN(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 0)
{
mysql_free_result();
format(string, sizeof(string), "{ffffff}Bienvenido al servidor, su cuenta no esta registrada.\nPara poder ingresar debe registrar su cuenta.\nIngrese su nueva contraseсa.");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD , "{FF0000}CLB - Registro", string, "Aceptar", "");
}
else
{
format(string, sizeof(string), "{ffffff}Bienvenido al servidor, {00FF00}%s{ffffff}!\nIntrodusca su contraseсa.",PlayerName(playerid));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD , "{FF0000}CLB - Ingreso", string, "Aceptar", "");

}
}
}

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;
}

Reply
#2

Somebody help me
Reply
#3

Show dialog ID 1 and 2's code...
Reply
#4

Well... I found this GM https://sampforum.blast.hk/showthread.php?tid=511000 , and i want to use that mod, bue it has this error; can you help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)