ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. passwordVerify

Function

passwordVerify

ServerMiscellaneousIdentical to MTA:SA

Checks whether a password matches a hash from passwordHash. With a callback the result goes to it.

Syntax

bool passwordVerify(string password, string hash [, table options, function callback])

Arguments

passwordstring
The typed password.
hashstring
The stored hash.
optionstable, optional
Unused.
callbackfunction, optional
function(matches).

Returns

true if the password matches.

Example

addEvent("login", true)
addEventHandler("login", root, function(password)
    local stored = getElementData(client, "hash")
    if stored and passwordVerify(password, stored) then
        outputChatBox("Zalogowano.", client)
    end
end)

See also