Create and scans a .ini highscore nearly instantly!
//should be defined in the first object created's Create Event
ini_open('custom_highscore.ini');
var addnew;
addnew = 11;
repeat(10)
{
addnew -= 1;
if !ini_key_exists('Names',string(addnew))
{
ini_write_string('Names',string(addnew),'<UNDEFINED>');
}
if !ini_key_exists('Scores',string(addnew))
{
ini_write_real('Scores',string(addnew),1000);
}
name[addnew] = ini_read_string('Names',string(addnew),'<UNDEFINED>');
score[addnew] = ini_read_real('Scores',string(addnew),1000))
};
ini_close();I think it might work with a for loop, but it's better to be safer and stick to repeat.
Used it before, I spurged the above code through memory, so can somebody test it first?
To access the name and the score, you can use the variables:
name[1], name[2], name[3], etc...
score[1], score[2], score[3], etc...
You can test the highscore via:
for(a = 0; a >= 10, a +=1){
if score > score[a]
{
score = score[a];
name[a] = get_string('NEW HIGHSCORE','');
break;
}
};
Edited by NukeTheCat, 24 June 2012 - 01:54 PM.









