21.02.2019, 00:50
okay this is driving me up the wall. i've tried everything before coming here so I hope you can help me i have wasted too much time on this already...
if i hash a password doesn't matter what method i use whether it be udb, wp or SHA256 SQL this occurs...
http://prntscr.com/mnxwvd
and this is only with password. everything else updates with no problems.
also it doesn't matter where i call the update query, the same thing occurs..
Table:
Hash & Update query
if you need more code just say so
if i hash a password doesn't matter what method i use whether it be udb, wp or SHA256 SQL this occurs...
http://prntscr.com/mnxwvd
and this is only with password. everything else updates with no problems.
also it doesn't matter where i call the update query, the same thing occurs..
Table:
pawn Код:
new string[1024];
strcat(string, "CREATE TABLE IF NOT EXISTS db_players (playerid INTEGER PRIMARY KEY AUTOINCREMENT, Username VARCHAR(24) COLLATE NOCASE, Pass VARCHAR(129) NOT NULL, salt VARCHAR(129), AdminLevel INTEGER DEFAULT 0 NOT NULL, PremiumLevel INTEGER DEFAULT 0 NOT NULL");
strcat(string, ", Experience INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 0 NOT NULL, Weapon_0 INTEGER DEFAULT 0 NOT NULL, Weapon_1 INTEGER DEFAULT 0 NOT NULL, Weapon_2 INTEGER DEFAULT 0 NOT NULL, Weapon_3 INTEGER DEFAULT 0 NOT NULL, Weapon_4 INTEGER DEFAULT 0 NOT NULL");
strcat(string, ", Kills INTEGER DEFAULT 0 NOT NULL, Deaths INTEGER DEFAULT 0 NOT NULL, DeagleKills INTEGER DEFAULT 0 NOT NULL, ShotgunKills INTEGER DEFAULT 0 NOT NULL, SniperKills INTEGER DEFAULT 0 NOT NULL, RifleKills INTEGER DEFAULT 0 NOT NULL, DuelsWon INTEGER DEFAULT 0 NOT NULL, DuelsLost INTEGER DEFAULT 0 NOT NULL)");
db_query(PlayersDB, string);
Hash & Update query
pawn Код:
if(dialogid == D_CHANGEPASS2)
{
if(response)
{
if(!strlen(inputtext))
{
return ShowPlayerDialog(playerid, D_CHANGEPASS, DIALOG_STYLE_MSGBOX, "Change password [2/2]", "Type in your new password\nERROR: You must enter a password", "Confirm", "Cancel"); // showing player the dialog to enter his correct and current password
}
if(!IsValidPassword(inputtext))
{
ShowPlayerDialog(playerid, D_CHANGEPASS, DIALOG_STYLE_PASSWORD, "Change password [2/2]", "Type in your new password\nERROR: The password is invalid, Valid characters are: A-Z, a-z, 0-9 ", "Confirm", "Cancel");
}
if(strlen(inputtext) < 3 || strlen(inputtext) > 24)
{
ShowPlayerDialog(playerid, D_CHANGEPASS, DIALOG_STYLE_PASSWORD, "Change password [2/2]", "Type in your new password.\nERROR: The password is invalid, Its length should be 3-24 characters", "Confirm", "Cancel");
}
SHA256_PassHash(inputtext, User[playerid][Salt], User[playerid][Password], 129);
new Query2[1024];
new string[128];
format(Query2, sizeof(Query2), "UPDATE db_players SET Pass = %q WHERE Username = %q", User[playerid][Salt], User[playerid][Password], 129, DB_Escape(Player[playerid][GlobalName]));
db_query(PlayersDB, Query2);
format(string, sizeof(string), "Your new password is: %s", inputtext);
ShowPlayerDialog(playerid, D_INFO, DIALOG_STYLE_MSGBOX, "Password changed!", string, "Confirm", "Cancel");
return 1;
}
}
if you need more code just say so