Hash password problem + rep
#1

My registration system use dini save system and i have one problem with user password's.
When player create account and type password that inputtext is going to num_hash,and save to pInfo.
But i don't wanna make that,i want when player typed password save that password to pInfo.
I try make without hashing code but not work,its only password=0..
I will put some codes:

Onplayerregister

Код:
public OnPlayerRegister(playerid, password[])
{
	if(IsPlayerConnected(playerid))
	{
		new string3[64];
		new string[128];
		new playersip[24];
		new playername3[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername3, sizeof(playername3));
		GetPlayerIp(playerid, playersip, sizeof(playersip));

		format(string3, sizeof(string3), "UER X2/Users/%s.ini", playername3);

    	dini_Create(string3);
		new password2 = num_hash(password);
		PlayerInfo[playerid][pKey] = password2;
		dini_IntSet(string3, "Password",password2);
Onplayerconnect

Код:
public OnPlayerLogin(playerid,password[])
{
	new tmp2[256]
	new	string2[64];
    new	string[128];
	new	playername2[MAX_PLAYER_NAME];
	new playersip[24];

    GetPlayerName(playerid, playername2, sizeof(playername2));
    GetPlayerIp(playerid, playersip, sizeof(playersip));

	format(string2, sizeof(string2), "UER X2/Users/%s.ini", playername2);

	if(dini_Exists(string2))
	{
	    new password2 = num_hash(password);
      	if(dini_Int(string2,"Password") == PlayerInfo[playerid][pKey])
		{
   			PlayerInfo[playerid][pKey] = dini_Int(string2,"Password");
And i have dialogs for registration under OnPlayerRequestClass

Код:
public OnPlayerRequestClass(playerid, classid)
{
    new string[4000];
 	if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
	{
	    PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/mmo1cocy8o/Harry_Potter_and_the_Sorcerer_s_Stone_Soundtrack_-12._Christmas_at_Hogwarts.mp3");
	    InterpolateCameraPos(playerid, 2440.208984, -1269.380249, 39.858142, 2421.712646, -1280.368041, 41.623828, 20000);
		InterpolateCameraLookAt(playerid, 2438.465576, -1264.761718, 39.064632, 2417.636718, -1283.257568, 41.428565, 20000);
	    ClearChatbox(playerid, 10);
	    if(gPlayerNalog[playerid] != 0)
		{
			ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"{EA0C0C}Dobrodosli,ulogujte se","Ukucajte {EA0C0C}password {FFFFFF}da bi se {EA0C0C}ulogovali{FFFFFF}.","Login","Izadji");
		}
	    else
		{
			ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_PASSWORD,"{EA0C0C}Dobrodosli, molimo Vas registrujte se","Upisite vas {EA0C0C}password {FFFFFF}da bi {EA0C0C}registrovali novi Nalog{FFFFFF}.","Registruj se","Izadji");
  		}
		LoginLog(string);
	}
 	else
	{
		SpawnPlayer(playerid);
		KillTimer(stopactimer[playerid]);
		stopactimer[playerid] = SetTimerEx("resumeanticheat", 3000, false, "i", playerid);
	}
	return false;
}
I will give rep + who help me to fix this
Reply
#2

Show the enum related to PlayerInfo[playerid][pKey]
Reply
#3

instead of it u can try
pawn Код:
dini_IntSet(yourfile, "Hash", udb_hash(inputtext));
Reply
#4

Код:
enum pInfo
{
        Float:pLastX,
	Float:pLastY,
	Float:pLastZ,
 	pKey
};
new PlayerInfo[MAX_PLAYERS][pInfo];
I have only that i don't have enum of pKey
Reply
#5

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
instead of it u can try
pawn Код:
dini_IntSet(yourfile, "Hash", udb_hash(inputtext));
i know for that i don't need that because it's hash my password i want make dont hash my password i make want to see real password of player who registered.
Reply
#6

ok under the hash maek
pawn Код:
dini_Set(YourFile, "Password", (inputtext));
That Will Show The Password Man! .
Reply
#7

Quote:
Originally Posted by osman2571
Посмотреть сообщение
i know for that i don't need that because it's hash my password i want make dont hash my password i make want to see real password of player who registered.
You should never do that, thats absolutely shitty behaviour and unproper administration.
Reply
#8

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
ok under the hash maek
pawn Код:
dini_Set(YourFile, "Password", (inputtext));
That Will Show The Password Man! .
When i put this under OnplayerRegister it's say undefined symbol inputtext..
Same public OnplayerRegister use playerid and password like this
Код:
OnPlayerRegister(playerid, password[]
Reply
#9

cuz u need to do this onplayerdialog
Reply
#10

*OnDialogResponse
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)