Dazee Posted June 23, 2015 Share Posted June 23, 2015 addEventHandler("onPlayerQuit",root, function() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local x,y,z = getElementPosition(source) local money = getPlayerMoney(source) setAccountData(acc,"PosX",x) setAccountData(acc,"PosY",y) setAccountData(acc,"PosZ",z) setAccountData(acc,"account.money",money) end end) function loggedIn(_,acc) if getAccountData(acc,"ever.logerin") == 1 then local x,y,z = getAccountData(acc,"PosX"),getAccountData(acc,"PosY"),getAccountData(acc,"PosZ") local Money = getAccountData(acc,"account.money") or 0 setPlayerMoney(source,Money) spawnPlayer(source,x,y,z) else setAccountData(acc,"ever.logerin",1) setPlayerMoney(source,15000) end fadeCamera(source, true) setCameraTarget(source) end addEventHandler("onPlayerLogin",root,loggedIn) The problem is that it does not log the player in if it's else what should I do here. Link to comment
Dazee Posted June 24, 2015 Author Share Posted June 24, 2015 The problem is when I register a new account with /register command something in loggedIn function blocks it from parsing the login when i try to login with that new account.Can you test the script please 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