Skip to content

How Do I Record HLTV Events ? #314

Discussion options

You must be logged in to vote

Unfortunately the only HLTV events that are recorded in demo files are hltv_status and hltv_chat. You can get the camera man with the following code:

function getCameraMan(): Player | null {
  const cameraManAccountId = parseInt(
    demoFile.conVars.vars.get("spec_autodirector_cameraman") || "0"
  );
  if (isNaN(cameraManAccountId) || cameraManAccountId <= 0) return null;

  return demoFile.entities.getByAccountId(cameraManAccountId);
}

However I don't think this spec_autodirector_cameraman convar is used. The game client does include logic for an 'auto director' that swaps between players/actions that are interesting, but this is something that you'd have to reimplement yourself.

Replies: 1 comment

Comment options

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