get correct roundtime #222
-
Hello, me again. I am trying to get the roundtime of when e.g. a kill happened in during a round. I am currently trying this: let stat = {
attackerName: attacker.name,
attackerHealth: attacker.health,
weapon: e.weapon,
// ...
roundNumber: demoFile.gameRules.roundNumber,
roundTime: demoFile.gameRules.getProp('DT_CSGameRules', 'm_iRoundTime')
}; but that just returns 115 which I believe is the total round time. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Raphael You'll have to get the current demo time (e.g. Thanks |
Beta Was this translation helpful? Give feedback.
Hi Raphael
You'll have to get the current demo time (e.g.
demo.currentTime
) when you see theround_start
game event. Store that time in a variable, then when you see a kill, you can subtract the currentdemo.currentTime
from the time you stored at round start. That will tell you how many seconds into the round the kill was.Thanks
Saul