SA-MP Forums Archive
How to save passoword using y_ini - 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: How to save passoword using y_ini (/showthread.php?tid=314610)



How to save passoword using y_ini - Ballu Miaa - 30.01.2012

Hello,

I am using y_ini currently to update my server. But ive used udb hasher to encrypt passwords if someone can tell me how to save pass word's as a string when a player using DIALOG_STYLE_PASSWORD and input's a text using the keyboard (ofc).

If somone know's how do it please share the information. Will appreciate as a human being and will rep as well being a forum active member.Thank you!

- Ballu Miaa


Re: How to save passoword using y_ini - Jochemd - 30.01.2012

pawn Код:
new File:file = INI_Open("account.ini");
INI_SetTag(file,"pData");
INI_WriteString(file,"Password",HASHEDPASSHERE);
You have to hash the "inputtext" in OnDialogResponse and make sure you open the right file. Does this help you? =D


Re: How to save passoword using y_ini - Ballu Miaa - 30.01.2012

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
pawn Код:
new File:file = INI_Open(string);
INI_SetTag(file,"pData");
INI_WriteString(file,"Password",HASHEDPASSHERE);
Does this help you? =D
I know about WriteString function of y_ini bu the problem is im not able to input it as a string using an INPUT DIALOG OR PASSWORD DIALOG. Please let me know if you know how to input it in under OnDialogResponse callback. Im using udb hasher to encrypt password and save as an integer!

Thanks for the reply


Re: How to save passoword using y_ini - Jochemd - 30.01.2012

pawn Код:
new File:file = INI_Open(string);
INI_SetTag(file,"pData");
INI_WriteString(file,"Password",udh_hash(inputtext));
udb_hash returns the hashed password. Got how it works now?


Re: How to save passoword using y_ini - Ballu Miaa - 30.01.2012

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
pawn Код:
new File:file = INI_Open(string);
INI_SetTag(file,"pData");
INI_WriteString(file,"Password",udh_hash(inputtext));
udb_hash returns the hashed password. Got how it works now?
So if i will use it as a string it will be the same on the .ini file as the person input's from the dialog. ?


Re: How to save passoword using y_ini - Jochemd - 30.01.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
So if i will use it as a string it will be the same on the .ini file as the person input's from the dialog. ?
Yeah, if you put "inputtext" in there it will write the text inputted of course. Though, recommended to hash.


Re: How to save passoword using y_ini - Ballu Miaa - 30.01.2012

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Yeah, if you put "inputtext" in there it will write the text inputted of course. Though, recommended to hash.
Im gonna test that tomorrow! I hope it work's thanks for the help mate. Peace! (Rep+)


Re: How to save passoword using y_ini - Jochemd - 30.01.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Im gonna test that tomorrow! I hope it work's thanks for the help mate. Peace! (Rep+)
You are welcome.


Re: How to save passoword using y_ini - Ballu Miaa - 31.01.2012

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
pawn Код:
new File:file = INI_Open(string);
INI_SetTag(file,"pData");
INI_WriteString(file,"Password",udh_hash(inputtext));
udb_hash returns the hashed password. Got how it works now?
When i use this as a string it says Tag type mismatch error!

Anyone can help me pleasE?


Re: How to save passoword using y_ini - DonWade - 31.01.2012

Very nice tutorial :

https://sampforum.blast.hk/showthread.php?tid=273088