Jump to content
  • 0

Problema GM BigZone (Criptare parola)


Question

Posted

Problema intalnita (descriere):Deci vreau sa fac criparea parolelor in gamemodul bigzone La OnplayerRegist merge dar la logare nu
Ero(area / rile) / warning-(ul / urile):  -
Liniile de cod / sursa / script-ul(obligatoriu): 

public OnPlayerRegister(playerid, password[])
{
	if(IsPlayerConnected(playerid))
	{
		new playername3[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername3, sizeof(playername3));
		new Str[200];
		new MyHash[256];
        SHA256_PassHash(password, "78sdjs86d2h", MyHash, sizeof(MyHash));
		mysql_format(SQL,Str,sizeof(Str),"INSERT INTO `users` (`name`,`password`) VALUES ('%s','%s')",playername3,MyHash);
		mysql_tquery(SQL,Str,"","");
		strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
		PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
	    GetPlayerHealthEx(playerid,PlayerInfo[playerid][pHealth]);
		if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
		{
     	    PlayerInfo[playerid][pPos_x] = 1482.0311;
     	    PlayerInfo[playerid][pPos_y] = -1331.4050;
     	    PlayerInfo[playerid][pPos_z] = 163.7188;
		}
		if(Spectate[playerid] != -1)
		{
			PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
			PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
			PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
			PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
			PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
		}
		new str[128];
		mysql_format(SQL,str,128,"UPDATE users SET `pHealth`='%.1f' WHERE `name`='%s'",PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pNormalName]);
		mysql_tquery(SQL,str,"","");
		new loginstring[182];
		new loginname[182];
		GetPlayerName(playerid,loginname,sizeof(loginname));
		format(loginstring,sizeof(loginstring),"{a9c4e4}Bun venit inapoi pe Blown RPG \n{a9c4e4}Cont:{ee5555} %s \n{a9c4e4}Acest cont este inregistrat",loginname);
		ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"{00FE37}Login",loginstring,"Login","Exit");
        new rezultat[256];
	    new Cache: cacheverificare = mysql_query(SQL, "SELECT * FROM `users` WHERE `id` > '0'");
		sumaconturi = cache_get_row_count();
		cache_delete(cacheverificare);
		new Cache: cacheverificare2 = mysql_query(SQL, "SELECT * FROM `users` ORDER BY `id` DESC LIMIT 1");
		for(new i, cache = cache_get_row_count(); i != cache; i++)
		{
			cache_get_field_content(i, "name", rezultat); format(celmainoucont, 40, rezultat);
		}
		cache_delete(cacheverificare2);
		new Cache: cacheverificare3 = mysql_query(SQL, "SELECT * FROM `recordjucatori` ORDER BY `id` DESC LIMIT 1");
		for(new i, cache = cache_get_row_count(); i != cache; i++)
		{
			cache_get_field_content(i, "record", rezultat); format(recordjucatori, 128, rezultat);
		}
		cache_delete(cacheverificare3);
		new string[2000];
		format(string, sizeof(string), "Accounts: ~y~%s~w~ / Newest account: ~y~%s ~w~/ Most players online: %s",FormatNumber(sumaconturi),celmainoucont,recordjucatori);
		TextDrawSetString(LoginInfo, string);
		TextDrawShowForPlayer(playerid, LoginInfo);
		return 1;
	}
	return 1;
}


Imagini / Video (optional): 

Recommended Posts

  • 0
  • Administrator
Posted
Just now, SUSANU said:

Cred ca nu e bine ceva la Onplayerregister

Nu, parola ta poate sa stocheze doar 50 de caractere in baza de date, mareste-o la 256.

  • 0
Posted
Acum 5 minute, WopsS a spus:

Nu, parola ta poate sa stocheze doar 50 de caractere in baza de date, mareste-o la 256.

Am rezolvat

Acuma cum fac sa changepass

  • 0
  • Administrator
Posted
Just now, SUSANU said:

Am rezolvat

Acuma cum fac sa changepass

Daca este legata de aceasi problema arata-ne codul, daca este alta problema deschide un alt subiect.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.