28.03.2019, 23:05
Hi, so I have noticed an issue on my script. I'll keep it short, here's everything:
I'm calling that OnPlayerConnect, and if you can notice this:
That's not being called.
I have tried to debug it and noticed it's not being called.
pawn Code:
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
if(response)
{
bcrypt_hash(inputtext, BCRYPT_COST, "OnPasswordHashed", "d", playerid);
print("Function called - DialogRegister");
}
else
Kick(playerid);
return 1;
}
pawn Code:
bcrypt_hash(inputtext, BCRYPT_COST, "OnPasswordHashed", "d", playerid);
pawn Code:
forward OnPasswordHashed(playerid);
public OnPasswordHashed(playerid)
{
new hash[BCRYPT_HASH_LENGTH], query[300];
bcrypt_get_hash(hash);
mysql_format(Database, query, sizeof(query), "INSERT INTO `players` (`Username`, `Password`, `IPAddress`, `Cash`, `Kills`, `Deaths`, `Admin`, `Banned`, `LastLogin`, `LastIP`) VALUES ('%e', '%e', '%e', 0, 0, 0, 0, 0, '%e', '%e')", GetName(playerid), hash, ReturnIP(playerid), ReturnDate(), ReturnIP(playerid));
mysql_tquery(Database, query, "OnPlayerRegister", "d", playerid);
print("Function called - OnPasswordHashed");
return 1;
}