Jump to content

toJSON


xXMADEXx

Recommended Posts

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:

qlhb.png

(http://img27.imageshack.us/img27/496/qlhb.png)

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