SA-MP Forums Archive
Help, registration sistem. - 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: Help, registration sistem. (/showthread.php?tid=534686)



Help, registration sistem. - CoR3 - 30.08.2014

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




Re: Help, registration sistem. - CoR3 - 31.08.2014

Somebody help me


Re: Help, registration sistem. - bensmart469 - 31.08.2014

Show dialog ID 1 and 2's code...


Re: Help, registration sistem. - CoR3 - 01.09.2014

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?