Skip to content
Discussion options

You must be logged in to vote

Okay so I was completely wrong about the hegrenade_bounce etc events. However you're right in that it looks like the grenade_bounce event isn't in the demo files. Even if it was, it has no useful information.

Instead use this code:

function printGrenadeLocation(grenade) {
  let modelParts = grenade.modelName.split('/');
  console.log('%d(%s) %O', grenade.handle, modelParts[modelParts.length-1], grenade.position);
}

demoFile.entities.on('postcreate', e => {
  if (e.entity.getProp('DT_BaseCSGrenadeProjectile', 'm_nBounces') === undefined)
    return;

  printGrenadeLocation(e.entity);
});

demoFile.entities.on('change', e => {
  if (e.varName !== 'm_nBounces')
    return;

  printGrenadeLo…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by saul
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #71 on February 28, 2021 14:00.