I made a script that saves informations about players, things like money. That works fine. It saves the data in a file with the Blockland ID as name.
It is simply one number in the file, not more. When the player connects to the server, it should load his saved informations. But, you guessed it, it doesn´t work...
function GameConnection::onClientEnterGame(%this)
{
%file = new FileObject();
%file.openForRead("config/TestScript/"@%this.BL_ID@".txt");
while(!%file.isEOF())
{
%line = %file.readLine();
echo(%line);
}
if(%line $= "") { %this.pointsCount = 0; }
else
{ %this.pointsCount = %line; }
%file.close();
%file.delete();
messageClient(%this,'',"You have "@%this.pointsCount@" Points on this Server");
parent::onClientEnterGame(%this);
}
What´s wrong?