GMDB
dashboard
user content
leaderboards
Avatar
documentation
SUPPORT
helpful links
WELCOME BACK
Documentation - Basic Leaderboards
setp up
Create a Basic Leaderboard to create your Leaderboard Unique Identifier.
sending your score
dataSource = "leaderboardString=string(UNIQUE-LEADERBOARD-STRING)&ownerString=string(UNIQUE-USER-STRING)&playerName=string(PLAYER-NAME)&playerScore=PLAYER-SCORE";

submitScore = http_post_string("https://www.gmdb.co.uk/data/insertScore.php", dataSource);
recieving scores
leaderboardData = "leaderboardString=string(UNIQUE-LEADERBOARD-STRING)&ownerString=string(UNIQUE-USER-STRING)";

getLeaderboard = http_post_string("https://www.gmdb.co.uk/data/get_leaderboard.php", leaderboardData);
ASYNC

if (ds_map_find_value(async_load, "id") == getLeaderboard)
  {
if (ds_map_find_value(async_load, "status") == 0)
     {

     getResult = ds_map_find_value(async_load, "result");
     getResultDecoded = json_decode(getResult);

     var getAllData = ds_map_find_value(getResultDecoded, "default");

     var leaderboardMapSize = ds_list_size(getAllData);

     for (var i = 0; i < leaderboardMapSize; i++)
           {
            leaderboardData = ds_list_find_value(getAllData, i);
            global.leaderboardPlayerName[i] =         string(ds_map_find_value(leaderboardData, "playerName")); //SAVES PLAY NAME INTO ARRAY
            global.leaderboardPlayerScore[i] = string(ds_map_find_value(leaderboardData, "playerScore")); // SAVES PLAYER SCORE INTO ARRAY

             //EXTRA VARIABLES
             global.leaderboardScoreSubmittedDate[i] = string(ds_map_find_value(leaderboardData, "scoreDate")); // SAVES THE DATE THE SCORE WAS SUBMITTED INTO AN ARRAY AS TIMESTAMP


           }

    }

}

STILL NEED HELP?
Submit a ticket and we will look into any issues you may have.
Submit Ticket