Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// oHighScore Display : Create Event
- r_str = "null";
- var getscore = 5;
- tagid = "[censored]";
- gmsb_post = http_post_string("http://gmscoreboard.com/handle_score.php?tagid="+string(tagid)+"&getscore="+string(getscore),"");
- /// oHighscoreDisplay : HTTP Event
- r_str = "null";
- if ds_map_find_value(async_load, "id") == gmsb_post
- {
- if ds_map_find_value(async_load, "status") == 0
- {
- r_str = ds_map_find_value(async_load, "result");
- }
- }
- //first decode the json string,
- //then you can get each variable by name just like gmsb_status below.
- gmsb_map = json_decode(r_str);
- gmsb_player1 = ds_map_find_value(gmsb_map , "p1");
- gmsb_score1 = ds_map_find_value(gmsb_map , "s1");
- gmsb_player2 = ds_map_find_value(gmsb_map , "p2");
- gmsb_score2 = ds_map_find_value(gmsb_map , "s2");
- gmsb_player3 = ds_map_find_value(gmsb_map , "p3");
- gmsb_score3 = ds_map_find_value(gmsb_map , "s3");
- gmsb_player4 = ds_map_find_value(gmsb_map , "p4");
- gmsb_score4 = ds_map_find_value(gmsb_map , "s4");
- gmsb_player5 = ds_map_find_value(gmsb_map , "p5");
- gmsb_score5 = ds_map_find_value(gmsb_map , "s5");
- /// oHighscoreDisplay : Draw Event
- if r_str != "null"{
- draw_set_font(fnt_hud);
- draw_set_halign(fa_center);
- draw_text_colour(room_width / 2, 32, "Regular Mode Top 5", c_black, c_black, c_black, c_black, 1);
- draw_text_colour((room_width / 2) + 2, 30, "Regular Mode Top 5", c_white, c_white, c_white, c_white, 1);
- draw_text_colour(room_width / 2, 256, "Infinite Mode Top 5", c_black, c_black, c_black, c_black, 1);
- draw_text_colour((room_width / 2) + 2, 254, "Infinite Mode Top 5", c_white, c_white, c_white, c_white, 1);
- draw_set_halign(fa_left);
- draw_text_colour(320,64,"\#1. " + string(gmsb_player1) + string(": ") + string(gmsb_score1), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,62,"\#1. " + string(gmsb_player1) + string(": ") + string(gmsb_score1), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,96,"\#2. " + string(gmsb_player2) + string(": ") + string(gmsb_score2), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,94,"\#2. " + string(gmsb_player2) + string(": ") + string(gmsb_score2), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,96 + 32,"\#3. " + string(gmsb_player3) + string(": ") + string(gmsb_score3), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,94 + 32,"\#3. " + string(gmsb_player3) + string(": ") + string(gmsb_score3), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,96 + 32 + 32,"\#4. " + string(gmsb_player4) + string(": ") + string(gmsb_score4), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,94 + 32 + 32,"\#4. " + string(gmsb_player4) + string(": ") + string(gmsb_score4), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,96 + 32 + 32 + 32,"\#5. " + string(gmsb_player5) + string(": ") + string(gmsb_score5), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,94 + 32 + 32 + 32,"\#5. " + string(gmsb_player5) + string(": ") + string(gmsb_score5), c_white, c_white, c_white, c_white, 1);
- }
- /// oInfiniteHighScoreDisplay : Create Event
- ir_str = "null";
- var getscore = 5;
- itagid = "[censored, but different from the first]";
- igmsb_post = http_post_string("http://gmscoreboard.com/handle_score.php?tagid="+string(itagid)+"&getscore="+string(getscore),"");
- /// oInfiniteHighScoreDisplay : HTTP Event
- ir_str = "null";
- if ds_map_find_value(async_load, "id") == igmsb_post
- {
- if ds_map_find_value(async_load, "status") == 0
- {
- ir_str = ds_map_find_value(async_load, "result");
- }
- }
- igmsb_map = json_decode(ir_str);
- igmsb_player1 = ds_map_find_value(igmsb_map , "p1");
- igmsb_score1 = ds_map_find_value(igmsb_map , "s1");
- igmsb_player2 = ds_map_find_value(igmsb_map , "p2");
- igmsb_score2 = ds_map_find_value(igmsb_map , "s2");
- igmsb_player3 = ds_map_find_value(igmsb_map , "p3");
- igmsb_score3 = ds_map_find_value(igmsb_map , "s3");
- igmsb_player4 = ds_map_find_value(igmsb_map , "p4");
- igmsb_score4 = ds_map_find_value(igmsb_map , "s4");
- igmsb_player5 = ds_map_find_value(igmsb_map , "p5");
- igmsb_score5 = ds_map_find_value(igmsb_map , "s5");
- /// oInfiniteHighscoreDisplay : Draw Event
- if ir_str != "null"{
- draw_set_font(fnt_hud);
- draw_set_halign(fa_left);
- draw_text_colour(320,288,"\#1. " + string(igmsb_player1) + string(": ") + string(igmsb_score1), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,286,"\#1. " + string(igmsb_player1) + string(": ") + string(igmsb_score1), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,320,"\#2. " + string(igmsb_player2) + string(": ") + string(igmsb_score2), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,318,"\#2. " + string(igmsb_player2) + string(": ") + string(igmsb_score2), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,320 + 32,"\#3. " + string(igmsb_player3) + string(": ") + string(igmsb_score3), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,318 + 32,"\#3. " + string(igmsb_player3) + string(": ") + string(igmsb_score3), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,320 + 32 + 32,"\#4. " + string(igmsb_player4) + string(": ") + string(igmsb_score4), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,318 + 32 + 32,"\#4. " + string(igmsb_player4) + string(": ") + string(igmsb_score4), c_white, c_white, c_white, c_white, 1);
- draw_text_colour(320,320 + 32 + 32 + 32,"\#5. " + string(igmsb_player5) + string(": ") + string(igmsb_score5), c_black, c_black, c_black, c_black, 1);
- draw_text_colour(322,318 + 32 + 32 + 32,"\#5. " + string(igmsb_player5) + string(": ") + string(igmsb_score5), c_white, c_white, c_white, c_white, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment