Jump to content

get pass problem


Desaster

Recommended Posts

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 :D

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

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...