manve1 Posted September 20, 2012 Share Posted September 20, 2012 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
TAPL Posted September 20, 2012 Share Posted September 20, 2012 mta has one already https://wiki.multitheftauto.com/wiki/Server_Commands#chgmypass Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now