MD5_Hash help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MD5_Hash help (
/showthread.php?tid=85229)
MD5_Hash help -
GTA_Rules - 06.07.2009
Hi,
I'm wondering if somebody could help me with this, every time I use /register it doesn't hash into the file, but it just gets saved the way I typed it. I'm wondering what's wrong. Also, would this login command work?
http://pastebin.com/m70ac397b
Thanks, bye!
Re: MD5_Hash help -
GTA_Rules - 06.07.2009
Anyone?
Re: MD5_Hash help -
Correlli - 06.07.2009
I believe MD5_Hash was created by ****** for YSI, so go and ask in that topic.
Re: MD5_Hash help -
-Sneaky- - 06.07.2009
I am not sure but I think you have todo:
pawn Код:
dcmd_register(playerid, params[])
{
new pName[24], PlayerFile[50],hashedPassword = strval(params);
GetPlayerName(playerid, pName, sizeof(pName));
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
if(dini_Exists(PlayerFile))
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You have already registered! Please use /login to login or choose another nicknname.");
return 1;
}
if(!dini_Exists(PlayerFile))
{
if (!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /register [password]");
dini_Create(PlayerFile);
dini_Set(PlayerFile, "Password", MD5_Hash(hashedPassword));
printf("Geregistreerd: %s, Pass: %s", pName, MD5_Hash(hashedPassword));
dini_IntSet(PlayerFile, "AdminLevel", 0);
dini_IntSet(PlayerFile, "Deaths", 0);
dini_IntSet(PlayerFile, "Kills", 0);
dini_IntSet(PlayerFile, "Banned", 0);
SendClientMessage(playerid, COLOR_GREEN, "You have succesfully registered, you have been automatically logged in.");
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][LoggedIn] = 1;
}
return 1;
}
Re: MD5_Hash help -
yom - 06.07.2009
Sneaky: You declare hashedPassword as an integer: strval(params); That is not what you want to do, right?
Anyway, rewrite your command according to this line:
pawn Код:
dini_Set(PlayerFile, "Password", MD5_Hash(params));
Re: MD5_Hash help -
GTA_Rules - 06.07.2009
Alright, thanks guys, I'll give it a try
.
Thansk for the help Sneaky and Orb