VerifyPassword
Whether a password made a hash text from HashPassword.
Syntax
Section titled “Syntax”VerifyPassword(password, hash)| Parameter | Type | |
|---|---|---|
password |
string | the password as the player typed it |
hash |
string | what HashPassword returned at the registration |
Returns
Section titled “Returns”boolean - false for a wrong password, an empty or a malformed hash
Example
Section titled “Example”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.") endend)See also
Section titled “See also”HashPassword · SetSecretCommand · the Accounts, admins, bans and the audit group of the index
