SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje serwera
  3. setAccountPassword

Funkcja

setAccountPassword

SerwerKontaIdentyczna z MTA:SA

Zmienia hasło konta.

Składnia

bool setAccountPassword(account theAccount, string password)

Argumenty

theAccountaccount
Konto.
passwordstring
Nowe hasło.

Zwraca

true przy powodzeniu.

Przykład

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)