SA-MP Forums Archive
Password Hash Problem & MYSQL Saving Problem - 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: Password Hash Problem & MYSQL Saving Problem (/showthread.php?tid=605349)



Password Hash Problem & MYSQL Saving Problem - Faqahat - 17.04.2016

Hello,
I was having problem while comparing password hashes while logging in so i printed both the hashes but one of them wasn't complete i cant figur out what the problem is exactly since variable are all greater then 128.
This is the password in Database


Here i am saving it in a variable:
(OnAccountCheck)


Here i am hashing entered password , printing and comparing


Here is the output




im having a syntax error in this query


Re: Password Hash Problem & MYSQL Saving Problem - introzen - 18.04.2016

In
PHP Code:
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `xLevel` = %d, `Toys` = %d, `Neons` = %d, `BoomBox` = %d, `Banned` = %d, `xVIP` = %d, `Score` = %d, `Respect` = %d, `Credits` = %d, `Drugs` = %d, `Kills` = %d, `Deaths` = %d, `MaxSpree` = %d, `TotalDuels` = %d, `DuelsWon` = %d, `DuelsLost` = %d,`Skin` = %d,`Muted` = %d,`Cash`= %d, `TotalSeconds` = %d, `LastLoggedIP` = '%e',`LastSeen` = '%e', WHERE `p_id` = %d "pInfo[playerid][pLevel], pInfo[playerid][Toys], pInfo[playerid][Neons], pInfo[playerid][BoomBox], pInfo[playerid][Banned], pInfo[playerid][VIP], GetPlayerScore(playerid), pInfo[playerid][Respect], pInfo[playerid][credits], pInfo[playerid][Drugs], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][MaxSpree], pInfo[playerid][TotalDuels], pInfo[playerid][DuelsWon], pInfo[playerid][DuelsLost], pInfo[playerid][Skin], pInfo[playerid][Muted], GetPlayerMoney(playerid), secondspIPstrpInfo[playerid][p_id]); 
mysql_tquery(mysqlquery"OnStatsSave""i"playerid); 
Change
PHP Code:
`LastSeen` = '%e'WHERE `p_id` = %
To
PHP Code:
`LastSeen` = '%e' WHERE `p_id` = %
Also show us your pInfo enum please.


Re: Password Hash Problem & MYSQL Saving Problem - Threshold - 18.04.2016

You're using printf instead of print. Also, I'm gonna go ahead and assume that you've only given p_password 100 cells instead of 129...

Change
pawn Code:
p_password[100]
to:
pawn Code:
p_password[129]



Re: Password Hash Problem & MYSQL Saving Problem - Faqahat - 18.04.2016

Quote:
Originally Posted by introzen
View Post
In
PHP Code:
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET `xLevel` = %d, `Toys` = %d, `Neons` = %d, `BoomBox` = %d, `Banned` = %d, `xVIP` = %d, `Score` = %d, `Respect` = %d, `Credits` = %d, `Drugs` = %d, `Kills` = %d, `Deaths` = %d, `MaxSpree` = %d, `TotalDuels` = %d, `DuelsWon` = %d, `DuelsLost` = %d,`Skin` = %d,`Muted` = %d,`Cash`= %d, `TotalSeconds` = %d, `LastLoggedIP` = '%e',`LastSeen` = '%e', WHERE `p_id` = %d "pInfo[playerid][pLevel], pInfo[playerid][Toys], pInfo[playerid][Neons], pInfo[playerid][BoomBox], pInfo[playerid][Banned], pInfo[playerid][VIP], GetPlayerScore(playerid), pInfo[playerid][Respect], pInfo[playerid][credits], pInfo[playerid][Drugs], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][MaxSpree], pInfo[playerid][TotalDuels], pInfo[playerid][DuelsWon], pInfo[playerid][DuelsLost], pInfo[playerid][Skin], pInfo[playerid][Muted], GetPlayerMoney(playerid), secondspIPstrpInfo[playerid][p_id]); 
mysql_tquery(mysqlquery"OnStatsSave""i"playerid); 
Change
PHP Code:
`LastSeen` = '%e'WHERE `p_id` = %
To
PHP Code:
`LastSeen` = '%e' WHERE `p_id` = %
Also show us your pInfo enum please.
Quote:
Originally Posted by Threshold
View Post
You're using printf instead of print. Also, I'm gonna go ahead and assume that you've only given p_password 100 cells instead of 129...

Change
pawn Code:
p_password[100]
to:
pawn Code:
p_password[129]
Thanks The issue is resolved