Skip to content

VerifyPassword

Whether a password made a hash text from HashPassword.

VerifyPassword(password, hash)
Parameter Type
password string the password as the player typed it
hash string what HashPassword returned at the registration

boolean - false for a wrong password, an empty or a malformed hash

db:Scalar("SELECT password FROM players WHERE name = @n", { n = name }, function(hash)
if hash and VerifyPassword(password, hash) then SendClientMessage(pid, COLOR_SERVER, "Logged in.") end
end)

HashPassword · SetSecretCommand · the Accounts, admins, bans and the audit group of the index