DakiLLa Posted September 9, 2008 Share Posted September 9, 2008 (edited) we all know that setAccountData deletes all accounts in accounts.acl but there is difficult to find any account data base or make own, but a few people know how to make it. So, should be another ways to solve this problem. post by lil Toady: setAccountData deletes stuff if you set data on a guest account, so check if player's accounts is guest one before setting data? i use that on my server and never had problems quick fix _setAccoutData = setAccounData function setAccountData ( account, data, value ) if ( not isGuestAccount ( account ) ) then return _setAccountData ( account, data, value ) end return false end I have this: function onQuit ( account, data, value ) local account = getClientAccount ( source ) if ( account ) then if ( not isGuestAccount ( account ) ) then local playermoney = getPlayerMoney ( source ) return setAccountData ( account, "lvdm.money", playermoney ) end return false end end function onJoin ( account, data, value ) local account = getClientAccount ( source ) if ( account ) then if ( not isGuestAccount ( account )) then local playermoney = getAccountData ( account, "lvdm.money" ) if ( playermoney ) then setPlayerMoney ( source, tonumber ( playermoney ) ) end end end end addEventHandler ( "onPlayerQuit", getRootElement (), onQuit ) addEventHandler ( "onPlayerJoin", getRootElement (), onJoin ) but all the same this function deletes accounts. may be i have mistakes in this code..So, if help, guys, to find them, it will be really useful script for more people who make their own rpg game styles. If it's impossible to solve this stupid bug - hm..waiting for dp3... Edited September 9, 2008 by Guest Link to comment
churchill Posted September 9, 2008 Share Posted September 9, 2008 maybe getAccountData deletes accounts as well? e.g before you do getAccountData, check if ( not isGuestAccount ( account ) ) then again? I dunno, I ended up writing the datamanager resource as a replacement for get/set AccountData, not that I've used it myself as I moved onto sql lite and mysql. Link to comment
Simbad de Zeeman Posted September 9, 2008 Share Posted September 9, 2008 This is soo strange , i never had any problems with getAccountData & setAccountData... Link to comment
Gamesnert Posted September 9, 2008 Share Posted September 9, 2008 This is soo strange , i never had any problems with getAccountData & setAccountData... And now you do, or still don't? If you still don't, then... What the ****? (not the F word, the H word. A little more polite. ) Never tried it, not intending to. Have my own system improving every few whiles. Link to comment
DakiLLa Posted September 9, 2008 Author Share Posted September 9, 2008 maybe getAccountData deletes accounts as well? e.g before you do getAccountData, check if ( not isGuestAccount ( account ) ) then again? does not help... Link to comment
Simbad de Zeeman Posted September 9, 2008 Share Posted September 9, 2008 This is soo strange , i never had any problems with getAccountData & setAccountData... And now you do, or still don't? If you still don't, then... What the ****? (not the F word, the H word. A little more polite. ) Never tried it, not intending to. Have my own system improving every few whiles. i still dont. 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