04 Mar 13, 08:54PM
(This post was last modified: 04 Mar 13, 08:59PM by Roflcopter.)
This is a script that provides a display_stats command which outputs the damage each player dealt and the average damage they dealt per life.
[cubescript]alias display_stats [
loop cn 20 [
stat_obj = (pstat_weap $cn);
dmg = 0;
loop i 10 [
dmg = (+ (at $stat_obj (+ (* $i 2) 1)) $dmg);
]
stat_obj = (pstat_score $cn);
deaths = (at $stat_obj 2);
if (> $dmg 0) [
say (concat (findpn $cn) " did " $dmg " damage (" (div $dmg $deaths) " av)");
]
]
][/cubescript]
There are several known bugs with it though
If anyone can provide fixes to these or other issues or general improvements it'd be great.
[cubescript]alias display_stats [
loop cn 20 [
stat_obj = (pstat_weap $cn);
dmg = 0;
loop i 10 [
dmg = (+ (at $stat_obj (+ (* $i 2) 1)) $dmg);
]
stat_obj = (pstat_score $cn);
deaths = (at $stat_obj 2);
if (> $dmg 0) [
say (concat (findpn $cn) " did " $dmg " damage (" (div $dmg $deaths) " av)");
]
]
][/cubescript]
There are several known bugs with it though
- It doesn't seem to reset your own damage
- The opening bracket in the output has a space after it
- It shouldn't output to chat (ie use echo instead of say)
- You need to be present the whole game or the damages are wrong
If anyone can provide fixes to these or other issues or general improvements it'd be great.