Desaster Posted November 19, 2013 Share Posted November 19, 2013 Hello, so my problem is that I mostly don't know how to get the pass of an account so I need your help I tryed many thing without any sucess here is my code addEvent( "onPlayerPasswordChange", true ) function onPlayerPasswordChange ( newPassword, newPassword2, oldPassword ) if ( newPassword ) and ( newPassword2 ) and ( oldPassword ) then local account = getPlayerAccount(source) if (account) then if (isGuestAccount(account)) then outputChatBox("You must be logged into an account to change your password.",source) return end if newPassword ~= newPassword2 then return end local password_check = getAccount(getAccountName(account), oldPassword) if (oldPassword==password_check) then if (string.len(newPassword)>=4) then setAccountPassword(account,newPassword) outputChatBox("you successfully changed your pass",source) else outputChatBox("Your new password must be at least 4 characters long.",source) end else outputChatBox("Old password invalid.",source) end end end end addEventHandler( "onPlayerPasswordChange", root, onPlayerPasswordChange ) Link to comment
Spajk Posted November 19, 2013 Share Posted November 19, 2013 https://wiki.multitheftauto.com/wiki/GetAccount Link to comment
Desaster Posted November 19, 2013 Author Share Posted November 19, 2013 [lua]local password_check = getAccount(getPlayerName(source), oldPassword)[lua] and still the same chatbox shows this : Old password invalid so the current pass get must be false Link to comment
Spajk Posted November 19, 2013 Share Posted November 19, 2013 Function getAccount returns an account element. Just do if(password_check) Link to comment
MIKI785 Posted November 19, 2013 Share Posted November 19, 2013 There is built-in command for password change, chgmypass. So you don't have to make your own one, try executeCommandHandler maybe? 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