- 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 != "")
- {
- fh = fopen(autocvar_sv_weaponstats_damagefile, FILE_APPEND);
- if(fh >= 0)
- {
- fputs(fh, "#begin damagefile\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)) * '1 0 0';
- if(f != 0)
- fputs(fh, strcat(prefix, ftos(i), "\t", ftos(j), "\t", ftos(f), "\n"));
+ idx = WEAPONSTATS_GETINDEX(i, ibot, j, jbot);
+ v = stov(bufstr_get(weaponstats_buffer, idx));
+ if(v != '0 0 0')
+ {
+ //vector is: kills hits damage
+ fputs(fh, sprintf("%s%d %d\t%d %d\t", prefix, i, ibot, j, jbot));
+ fputs(fh, sprintf("%d %d %g\n", v_x, v_y, v_z));
+ }