gms_highscore_add

Usage: gms_highscore_add ( list_id, score )

Description

Adds the score to the highscorelist. If the user does have a saved score, it will be replaced

Replies (16)

Last message on 24 Oct 2016

Miksamoo on 15 Aug 2015, 12:43:24
Hello, I'm back. Is there function to remove certain highscore? I know I can do it via website, but I want to remove them in-game.
Size43 (Administrator) on 20 Aug 2015, 21:45:14
You can replace / update the highscores of the player that's logged in, but it's impossible to remove a highscore in-game. (Because of the way GameMaker Server works, being able to remove any highscore would mean anyone could clear the highscores of any game. That's why I've chosen to only allow replacing/updating your own score programatically.)
conanphamtuan on 24 Oct 2016, 13:44:47
I can do that to remove certain highscore?
gms_highscore_add ( list_id, -gms_highscore_self_score ( list_id ))
Forgeio on 4 Aug 2015, 17:11:48
How do I embed this on my website if its possible? if its not possible, could you maybe add it? I really wanted a list of the top players on my website :P
Size43 (Administrator) on 9 Aug 2015, 14:15:59
Apologies for my delayed responses. As you may know, Outlook is blocking all GameMaker Server mails which means I don't get notified when you post a reply.

On the developer page of your game, there's a link "Dynamic images". You can generate URLs for images with the number of players online and for specific highscores. You can also configure colors & font size.
Forgeio on 9 Aug 2015, 18:41:55
thanks :)
Orbacal on 21 Aug 2014, 11:20:29
Nevermind, i managed to get highscore window showing, but it is always blank, no highscores D:
Orbacal on 21 Aug 2014, 21:50:47
So could you please help me show the highscore list? It shows a window, but it is blank, only I can view highscores via game setting on this site.
Size43 (Administrator) on 22 Aug 2014, 10:31:22
The ID should be visible on the highscore settings page, but it isn't. If you look at the address bar, you should see something like this: developer/game/xxx/highscores/yyy/. yyy is the highscorelistID. I'll add the highscoreID to the highscore settings page as soon as I can.
Orbacal on 22 Aug 2014, 11:11:05
Soo how do i make highscore list shown? Highscore window shows, but it is blank there aren't any highscores in it, even though highscores page here (on site) shows all of them.
Size43 (Administrator) on 22 Aug 2014, 11:36:30
I've added the HighscorelistID to the "Edit highscore" page. Please make sure you're calling gms_show_highscore with the right ID. Please also make sure the game is connected to the server by checking gms_info_isconnected.

If you're calling gms_show_highscore before the scores are received they may not be updated properly.
NodziGames on 21 Nov 2014, 12:35:22
I am having the same problem. I've done all the ID stuff but my highscore screen is blank, despite the entries which are visible on my developer page!
Size43 (Administrator) on 21 Nov 2014, 17:39:21
I'll look into this. Do the highscore functions themselves work or in other words, are you able to see the correct highscore information when calling functions like gms_highscore_name?
NodziGames on 22 Nov 2014, 14:41:55
I tested that script and it works just fine too! The issue is with the drag and drop highscore table. Do you think you'll be able to sort it out before the indiesvspewdiepie jam ends? Or could you perhaps show me how to draw my own highscore table with ranks?
Size43 (Administrator) on 22 Nov 2014, 16:18:29
I'm working on fixing it, but it'll have to go into the next big update. While the update is almost done, I do want to make sure I release something that actually works, so no guarantees :)

Here's how to draw highscores using the gms_highscore_* functions (set hID to your highscorelist ID):

var n, hID;
hID = 10;
for(n = 0; n < server_highscore_count(hID); n += 1)
{
    draw_text(x, y + i * 32
        string(i + 1) + ". " + server_highscore_name(hID, i))
    draw_text(x + 300, y + i * 32
        string(server_highscore_score(hID, i)))
}


You'll probably need to edit the x and y positions a bit. ;)
Orbacal on 21 Aug 2014, 10:13:16
Hi. How i am supposed to know which List Id has the highscore list?