- if(autocvar_sv_weaponstats_killfile != "")
- {
- fh = fopen(autocvar_sv_weaponstats_killfile, FILE_APPEND);
- if(fh >= 0)
- {
- fputs(fh, "#begin killfile\n");
- fputs(fh, strcat("#date ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
- fputs(fh, strcat("#config ", ftos(crc16(FALSE, cvar_changes)), "\n"));
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- for(j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- idx = WEAPONSTATS_GETINDEX(i, j);
- f = stov(bufstr_get(weaponstats_buffer, idx)) * '0 1 0';
- if(f != 0)
- fputs(fh, strcat(prefix, ftos(i), "\t", ftos(j), "\t", ftos(f), "\n"));
- }
- fputs(fh, "#end\n\n");
- fclose(fh);
- print("Weapon kill stats written\n");
- }
- }
- if(autocvar_sv_weaponstats_damagefile != "")