change pass
#2

https://sampwiki.blast.hk/wiki/SHA256_PassHash

Third parameter is the returned hash, first parameter is const so don't assign the third parameter to the 1st parameter.

PHP код:
CMD:changepass(playerid,params[])  

    new 
Query[100], pass[200]; 
    if(
sscanf(params"s[200]"pass)) return Usage(playerid"/changepass [password]"); 
    if(
strlen(pass) < || strlen(pass) > 12) return Error(playerid"Incorrect Password length"); 
    
SHA256_PassHash(passpInfo[playerid][Salt], pInfo[playerid][Password], 65); 
    
//pInfo[playerid][Password] = pass; 
    
mysql_format(DatabaseQuerysizeof(Query), "UPDATE `users` SET `Password` = '%e'  WHERE `pID` =%d LIMIT 1"pInfo[playerid][Password], pInfo[playerid][pID]); 
    
mysql_tquery(DatabaseQuery,"",""); 
    
format2(playeridCOLOR_LIGHTGREEN"Your password has been successfully changed to (%s)"str); 
    return 
1

pass has the normal password.
pInfo[playerid][Password] has the hashed password.
Reply


Messages In This Thread
change pass - by CaptainBoi - 15.06.2018, 14:19
Re: change pass - by jlalt - 15.06.2018, 14:23
Re: change pass - by CaptainBoi - 15.06.2018, 14:25
Re: change pass - by jlalt - 15.06.2018, 14:27
Re: change pass - by CaptainBoi - 15.06.2018, 14:33
Re: change pass - by CaptainBoi - 15.06.2018, 15:35
Re: change pass - by DaniceMcHarley - 15.06.2018, 15:43
Re: change pass - by CaptainBoi - 15.06.2018, 15:58
Re: change pass - by jlalt - 15.06.2018, 16:05
Re: change pass - by CaptainBoi - 15.06.2018, 16:14

Forum Jump:


Users browsing this thread: 5 Guest(s)