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

Function

setAccountPassword

ServerAccountsIdentical to MTA:SA

Changes an account's password.

Syntax

bool setAccountPassword(account theAccount, string password)

Arguments

theAccountaccount
The account.
passwordstring
The new password.

Returns

true on success.

Example

addCommandHandler("zmienhaslo", function(player, cmd, old, new)
    local account = getPlayerAccount(player)
    if isGuestAccount(account) or not getAccount(getAccountName(account), old) then
        outputChatBox("Złe hasło.", player, 255, 0, 0)
        return
    end
    setAccountPassword(account, new)
    outputChatBox("Hasło zmienione.", player, 0, 255, 0)
end)