Jump to content

Don't work


manve1

Recommended Posts

function ChangePlayerPassword(player,command,oldpass,newpass) 
    local account = getPlayerAccount(player) 
    if (account) then 
        if (isGuestAccount(account)) then 
            outputChatBox("You must be logged into an account to change your password.",player)  
            return 
        end 
  
        local password_check = getAccount(getPlayerUserName(player),oldpass) 
        if (oldpass==password_check) then 
            -- check the length of the new password 
            if (string.len(newpass)>=5) then 
                setAccountPassword(account,newpass) 
            else 
                outputChatBox("Your new password must be at least 5 characters long.",player) 
            end 
        else 
            outputChatBox("Old password invalid.",player) 
        end 
    end 
 end 
addCommandHandler("changepass",ChangePlayerPassword) 

i copied this from mta wiki, and it doesn't work, keeps saying "old password invalid" and has error of getAccount on line 9

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...