xXMADEXx Posted September 28, 2013 Share Posted September 28, 2013 Hello. I have this problem, for some reason toJSON won't load my entire table. Here is the code: local candidates = { { 'Khalil', 0 }, { 'Omega', 0 }, { 'Redbull', 0 }, { 'Pillow', 0 }, { 'xXMADEXx', 0 }, { 'Zach', 0 } , { 'Jericho', 0 }, { 'CyberDax', 0 }, { 'Pie', 0 }, { 'Mr.Shariq', 0 }, { 'Turbo-X', 0 }, { 'Snoop', 0 }, { 'Shadow', 0 }, { 'Sky', 0 }, { 'Mr.Tom', 0 }, { 'Mody', 0 }, { 'Misho', 0 }, } local hasVoted = { } -- More stuff though here, but you don't need it. addEventHandler ( "onResourceStop", resourceRoot, function ( ) local vals = { candidates, hasVoted } local json = toJSON ( vals ) setAccountData ( getAccount ( "Console" ), "ElectionData", json ) end ) And, here is what it does: (http://img27.imageshack.us/img27/496/qlhb.png) Link to comment
myonlake Posted September 28, 2013 Share Posted September 28, 2013 As far as I know, element/account datas do have a limit of bytes it can handle. Try using SQLite for storing that JSON. Link to comment
Castillo Posted September 28, 2013 Share Posted September 28, 2013 As myonlake said, account data has a string limit, so your JSON string will cut off at some point, you should use either SQLite or MySQL, or just find a work-around for account data. 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