Well here's the file thing
And the hud's like thisCode: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); }
Hud is called at playerspawn, and load file is called at playerconnectCode: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); }



Reply With Quote