Displaying only 5 of the high scores

Hello,
I am using the high score system from the wiki:http://wiki.unity3d.com/index.php?title=Server_Side_Highscores
It works fine i can add high score and I can display it.

my question is: how can i check if the player got a high score greater than the lowest high score–I just want to display five only.

When i do a Debug.Log(hs_get.text);

it gives me name and score for every one not an integer:

how can i do something like this:

if(score>lowestHighestScore){
SHOW THE gui stuff to add the new score and name;
}
else{
just show the score no gui;
}

Thanks

Well just search for scores in the Sring. So basicly check for String[0] if it is number, if so check if String[1] is also a number. and then you just add up all the numbers giving you back your score.

The easier way would be if you’d always enter something like aaa121340bbb while 121340 is your score and the aaa just indicate that your score starts there. And the bbb indicates that the score ends there. So you just need search where a aaa is and then take all the characters between the aaa and the first bbb which comes later on. Take those characters in a separate String and then you can convert that string to an int.

If you do so you should always keep in mind that hackers might find out about that technique so you might want to forbid the player to use aaa and bbb in their username :wink:

that’s the easiest solution I see.

Otherwise you could just modify the php script on the server side but I can’t help you out with that :wink: