Here you go:
exec("config/server/scores.cs");
function saveaclientscore(%client)
{
$Scores[%client.BL_ID] = %client.score;
$ScoresSet[%client.BL_ID] = 1;
export("$ScoresSet*","config/server/scores.cs");
export("$Scores*","config/server/scores.cs");
}
package savepos
{
function GameConnection::onClientEnterGame(%client)
{
Parent::onClientEnterGame(%client);
if($ScoresSet[%client.BL_ID])
%client.incScore($Scores[%client.BL_ID]);
}
function GameConnection::onClientLeaveGame(%client)
{
saveaclientscore(%client);
Parent::onClientLeaveGame(%client);
}
};
activatepackage(savepos);
function serverCmdclearscores(%client)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
deleteVariables("$Scores*");
deleteVariables("$ScoresSet*");
messageall('',%client.name SPC "has just cleared all stored records of scores.");
}
}
Would you like this packaged in a .zip like a normal add-on or would you just like to take it like this?
Also, you can type /clearscores as an admin or super admin to clear all *saved* scores, ingame scores will not be affected.
The scores are saved in <blockland directery>/config/server/scores.cs where each person who has their score saved has an entry like this:
$Scores22749 = "108";
$ScoresSet22749 = 1;
which is about as little space as it can possibly take up. (granted I could make the $scoreset variables not required, but it doesn't matter)
And yes, even if you restart sever the scores will be saved.
And you don't even really need to restart your server to start this script, as it adds no datablocks.
EDIT:
Packed download link is here:
http://www.mediafire.com/download.php?nyy6mc3sd9wks53