Mysql not logging password - 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: Mysql not logging password (
/showthread.php?tid=456258)
Mysql not logging password -
Blademaster680 - 05.08.2013
Mysql is saving everything correct but the password in the database is blank and dont understand what is wrong with it
Код:
stock RegisterPlayer(playerid, regpass[])
{
new query[256], EncryptedPass[130];
WP_Hash(EncryptedPass, sizeof(EncryptedPass), regpass);
format(query, sizeof(query), "INSERT INTO accounts (Name, Password, PlayerPos, Skin) VALUES ('%s', '%s', '1.0 2.0 3.0', '299')", GetName(playerid), EncryptedPass);
mysql_query(query);
LoginPlayer(playerid);
return 1;
}
Код:
case dialogThreadRegister:
{
if(response)
{
RegisterPlayer(playerid, inputtext);
}
if(!response)
{
Kick(playerid);
}
}
Could someone please help me? Everything saves perfect except the password they type, which is confusing because everything looks right.
Re: Mysql not logging password - Emmet_ - 05.08.2013
First of all, you're using the "PlayerPos" field wrong. Execute these SQL queries:
pawn Код:
ALTER TABLE `Accounts`
ADD COLUMN `PlayerX` FLOAT DEFAULT 0.0,
ADD COLUMN `PlayerY` FLOAT DEFAULT 0.0,
ADD COLUMN `PlayerZ` FLOAT DEFAULT 0.0;
And use this code instead:
pawn Код:
stock RegisterPlayer(playerid, regpass[])
{
new query[256], EncryptedPass[130];
WP_Hash(EncryptedPass, sizeof(EncryptedPass), regpass);
format(query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `PlayerX`, `PlayerY`, `PlayerZ`, `Skin`) VALUES ('%s', '%s', '1.0', '2.0', '3.0', 299)", GetName(playerid), EncryptedPass);
mysql_query(query);
LoginPlayer(playerid);
return 1;
}
If that doesn't work, then you're improperly using the function in your code somewhere.
Re: Mysql not logging password -
Blademaster680 - 05.08.2013
Nope still nothing.
It is almost like its not getting the password that i am typing into the dialog