Well here's the file thing
Code:
load()
{
guid = self getGuid();
if(guid == 0)
return;
file = openFile(guid + ".txt", "read");
if(file != -1)
{
freadln(file);
self.ratio=int(fgetarg(file,0));
closeFile(file);
}
else
{
self.ratio = 0;
self write();
}
}
write()
{
guid = self getGuid();
if(guid == 0)
return;
file = openFile(guid + ".txt", "write");
closeFile(file);
file = openFile(guid + ".txt", "append");
fPrintln(file,self.ratio);
closeFile(file);
}
And the hud's like this
Code:
ratio()
{
self endon("joined_spectators");
self endon("disconnect");
self.ratio = self.score / self.deaths;
if(!isDefined(self.ratiohud))
self.ratiohud = newClientHudElem(self);
self.ratiohud.vertAlign = "fullscreen";
self.ratiohud.horzAlign = "fullscreen";
self.ratiohud.alignX = "left";
self.ratiohud.alignY = "middle";
self.ratiohud.x = 25;
self.ratiohud.y = 474;
self.ratiohud.sort = 1;
self.ratiohud.alpha = 1;
self.ratiohud.fontScale = 0.8;
self.ratiohud.archived = true;
self.ratiohud.label = (game["ratio"]);
self.ratiohud setValue(self.ratio);
}
Hud is called at playerspawn, and load file is called at playerconnect