• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Http_post_string problems

N

nicoltoons

Guest
I am having trouble posting to a database url that stores names, emails and highscores.
This is the json format
{
"name": "Tonit",
"email": "[email protected]",
"highscore": {
"Int64": 0,
"Valid": true
}


This is my data
var q= ds_map_create();
var scores = ds_map_create();
ds_map_add(q, "name", global.name)
ds_map_add(q,"email",global.email)
ds_map_add_map(q,"highscore",scores)
ds_map_add(scores,"Int64",global.highscore)
ds_map_add(scores,"Valid","true")

//posting the string to the url
http_post_string("url",json_encode(q))
show_message("Q: " + json_encode(q))

ds_map_destroy(scores)
ds_map_destroy(q)


//What my ds_map returns

{"name":"Tgirl","email":"[email protected]","highscore":{"Valid":true",Int64":0.000000}},


//What it should return
{"name":"Tgirl","email":"[email protected]","highscore":{"Int64":0,"Valid":true}}


I have no idea why string(global.highscore) is a float and not an integer.
 
Top