> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: Cheat Events
description: Catalog of CS:GO game events you can hook with the events namespace
icon: zap
---

Game events let your script react to what happens in the game. Index the [`events`](/csgo/api-reference/namespaces/events) namespace with an event name to get an event object, then register a callback with `:set`.

<Card title="events namespace" icon="zap" href="/csgo/api-reference/namespaces/events" horizontal>
  In order to reference an event, index the `events` namespace with an event name.
</Card>

<Card title="Official CS:GO events" icon="external-link" href="https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events" horizontal>
  Reference list of standard CS:GO game events on the AlliedModders wiki.
</Card>

<Expandable title="Example">
  ```lua lines=false
  local hitgroup_str = {
      [0] = 'generic',
      'head', 'chest', 'stomach',
      'left arm', 'right arm',
      'left leg', 'right leg',
      'neck', 'generic', 'gear'
  }

  events.player_hurt:set(function(e)
      local me = entity.get_local_player()
      local attacker = entity.get(e.attacker, true)

      if me == attacker then
          local user = entity.get(e.userid, true)
          local hitgroup = hitgroup_str[e.hitgroup]

          print(('Hit %s in the %s for %d damage (%d health remaining)'):format(
              user:get_name(), hitgroup,
              e.dmg_health, e.health
          ))
      end
  end)
  ```
</Expandable>

## render

Fired every frame. Most functions from the [`render`](/csgo/api-reference/namespaces/render) namespace can only be used here.

<Expandable title="Example">
  ```lua lines=false
  events.render:set(function(ctx)
      render.rect(vector(0, 0), vector(1920, 1080), color(230, 150))
  end)
  ```
</Expandable>

## render\_glow

Fired every time the game prepares the glow object manager. This event gives you the ability to render glow lines. Access the renderer by adding an argument to the callback.

```lua
ctx:render(from: vector, to: vector, thickness: number, flags: string, color: color)
```

<Schema title="Parameters">
  <SchemaField name="from" type="vector">
    Start position in world space.
  </SchemaField>

  <SchemaField name="to" type="vector">
    Final position in world space.
  </SchemaField>

  <SchemaField name="thickness" type="number">
    Line thickness as a number in the range \[0.0, ∞].
  </SchemaField>

  <SchemaField name="flags" type="string">
    Glow flags. `l` to draw line, `g` to draw `glow` outline, or `w` to make it fully visible behind walls.
  </SchemaField>

  <SchemaField name="color" type="color">
    Color of the line.
  </SchemaField>
</Schema>

<Expandable title="Example">
  ```lua Anti-aim direction glow lines lines=false
  local real_yaw, abs_yaw = 0, 0

  events.createmove:set(function(cmd)
      local me = entity.get_local_player()
      local anim_state = me:get_anim_state()

      if not anim_state or cmd.choked_commands > 0 then
          return
      end

      real_yaw = anim_state.eye_yaw
      abs_yaw = anim_state.abs_yaw
  end)

  events.render_glow:set(function(ctx)
      local me = entity.get_local_player()

      if not me or not me:is_alive() then
          return
      end

      local origin = me:get_origin()
      local real_yaw_dir = origin + (vector():angles(0, real_yaw) * 20)
      local abs_yaw_dir = origin + (vector():angles(0, abs_yaw) * 25)

      ctx:render(origin, real_yaw_dir, 0.15, 'lg', color(255, 0, 0)) -- Real yaw
      ctx:render(origin, abs_yaw_dir, 0.15, 'g', color(35, 215, 235)) -- Body yaw
  end)
  ```
</Expandable>

## override\_view

Fired every time the game prepares the camera view.

<Schema title="Callback fields">
  <SchemaField name="fov" type="number">
    Field of View.
  </SchemaField>

  <SchemaField name="view" type="vector">
    Camera view angles.
  </SchemaField>

  <SchemaField name="camera" type="vector">
    World position of the camera.
  </SchemaField>
</Schema>

## createmove

Fired every time the game prepares a move command. Use this to modify something before the aimbot or movement features. Use the parameter passed by the callback to access the `command` struct.

<Expandable title="Example">
  ```lua lines=false
  -- Sets the Roll angle when Shift (+speed) is being held
  events.createmove:set(function(cmd)
      if cmd.in_speed then
          cmd.view_angles.z = 50 -- you are now unhittable
      end
  end)
  ```
</Expandable>

<AccordionGroup>
  <Accordion title="struct command">
    The move command passed to the `createmove` callback. Read and write its fields to influence movement and the cheat's behavior for the current command.

    <Schema>
      <SchemaField name="block_movement" type="number">
        Set to `1` to make the cheat slow you down to the weapon's minimal speed, or set to `2` to fully stop you. Defaults to `0`.
      </SchemaField>

      <SchemaField name="no_choke" type="boolean">
        Set to `true` to force the cheat to not choke the current command.
      </SchemaField>

      <SchemaField name="send_packet" type="boolean">
        Set to `false` to force the cheat to choke the current command.
      </SchemaField>

      <SchemaField name="force_defensive" type="boolean">
        Set to `true` to trigger the `'defensive'` exploit (Double tap is required to be fully charged).
      </SchemaField>

      <SchemaField name="jitter_move" type="boolean">
        Set to `false` to disable jitter move.
      </SchemaField>

      <SchemaField name="choked_commands" type="number">
        Amount of choked commands.
      </SchemaField>

      <SchemaField name="command_number" type="number">
        Current command number.
      </SchemaField>

      <SchemaField name="tickcount" type="number">
        Current command tickcount.
      </SchemaField>

      <SchemaField name="random_seed" type="number">
        Current command random seed.
      </SchemaField>

      <SchemaField name="view_angles" type="vector">
        Player view angles.
      </SchemaField>

      <SchemaField name="move_yaw" type="number">
        Movement yaw angle.
      </SchemaField>

      <SchemaField name="forwardmove" type="number">
        Forward / backward speed.
      </SchemaField>

      <SchemaField name="sidemove" type="number">
        Left / right speed.
      </SchemaField>

      <SchemaField name="upmove" type="number">
        Up / down speed.
      </SchemaField>

      <SchemaField name="in_attack" type="boolean">
        `+attack`
      </SchemaField>

      <SchemaField name="in_attack2" type="boolean">
        `+attack2`
      </SchemaField>

      <SchemaField name="in_use" type="boolean">
        `+use`
      </SchemaField>

      <SchemaField name="in_jump" type="boolean">
        `+jump`
      </SchemaField>

      <SchemaField name="in_duck" type="boolean">
        `+duck`
      </SchemaField>

      <SchemaField name="in_walk" type="boolean">
        `+walk`
      </SchemaField>

      <SchemaField name="in_speed" type="boolean">
        `+speed`
      </SchemaField>

      <SchemaField name="in_reload" type="boolean">
        `+reload`
      </SchemaField>

      <SchemaField name="in_moveleft" type="boolean" />

      <SchemaField name="in_moveright" type="boolean" />

      <SchemaField name="in_forward" type="boolean" />

      <SchemaField name="in_back" type="boolean" />

      <SchemaField name="in_left" type="boolean" />

      <SchemaField name="in_right" type="boolean" />

      <SchemaField name="in_bullrush" type="boolean" />
    </Schema>
  </Accordion>
</AccordionGroup>

## createmove\_run

Fired every time the game runs a move command. Use the parameter passed by the callback to access the `run_command` struct.

<AccordionGroup>
  <Accordion title="struct run_command">
    The move command passed to the `createmove_run` callback.

    <Schema>
      <SchemaField name="choked_commands" type="number">
        Amount of choked commands.
      </SchemaField>

      <SchemaField name="command_number" type="number">
        Current command number.
      </SchemaField>

      <SchemaField name="tick_count" type="number">
        Current command tick count.
      </SchemaField>

      <SchemaField name="move_yaw" type="number">
        Movement yaw angle.
      </SchemaField>

      <SchemaField name="forwardmove" type="number">
        Forward / backward speed.
      </SchemaField>

      <SchemaField name="sidemove" type="number">
        Left / right speed.
      </SchemaField>

      <SchemaField name="upmove" type="number">
        Up / down speed.
      </SchemaField>
    </Schema>
  </Accordion>
</AccordionGroup>

## aim\_fire

Fired every time the aimbot shoots at a player.

<Schema title="Callback fields">
  <SchemaField name="id" type="number">
    Shot ID.
  </SchemaField>

  <SchemaField name="target" type="entity">
    Target entity.
  </SchemaField>

  <SchemaField name="damage" type="number">
    Estimated damage.
  </SchemaField>

  <SchemaField name="hitchance" type="number">
    Estimated hit chance.
  </SchemaField>

  <SchemaField name="hitgroup" type="number">
    Targeted hitgroup.
  </SchemaField>

  <SchemaField name="backtrack" type="number">
    Amount of ticks the player was backtracked.
  </SchemaField>

  <SchemaField name="aim" type="vector">
    World position of the aim point.
  </SchemaField>

  <SchemaField name="angle" type="vector">
    Aimbot shoot angles.
  </SchemaField>
</Schema>

## aim\_ack

Fired when an aimbot shot is acknowledged, reporting the resolved result of a previous `aim_fire`.

<Schema title="Callback fields">
  <SchemaField name="id" type="number">
    Shot ID.
  </SchemaField>

  <SchemaField name="target" type="entity">
    Target entity.
  </SchemaField>

  <SchemaField name="damage" type="number">
    Actual shot damage.
  </SchemaField>

  <SchemaField name="spread" type="number">
    Bullet spread angle if available.
  </SchemaField>

  <SchemaField name="hitchance" type="number">
    Actual shot hit chance.
  </SchemaField>

  <SchemaField name="hitgroup" type="number">
    Hitgroup that was hit.
  </SchemaField>

  <SchemaField name="backtrack" type="number">
    Amount of ticks the player was backtracked.
  </SchemaField>

  <SchemaField name="aim" type="vector">
    World position of the aim point.
  </SchemaField>

  <SchemaField name="wanted_damage" type="number">
    Targeted damage.
  </SchemaField>

  <SchemaField name="wanted_hitgroup" type="number">
    Targeted hitgroup.
  </SchemaField>

  <SchemaField name="state" type="string">
    Reason the shot was missed, or `nil` if the shot was hit. Available miss reasons: `spread`, `correction`, `misprediction`, `prediction error`, `backtrack failure`, `damage rejection`, `unregistered shot`, `player death`, `death`.
  </SchemaField>
</Schema>

## bullet\_fire

Fired every time someone fires a bullet.

<Schema title="Callback fields">
  <SchemaField name="entity" type="entity">
    Entity that did the shot.
  </SchemaField>

  <SchemaField name="origin" type="vector">
    Entity world position.
  </SchemaField>

  <SchemaField name="angles" type="vector">
    Aim angle based on entity rotation.
  </SchemaField>

  <SchemaField name="sound" type="number">
    Sound type.
  </SchemaField>

  <SchemaField name="spread" type="number">
    Weapon spread.
  </SchemaField>

  <SchemaField name="inaccuracy" type="number">
    Weapon inaccuracy.
  </SchemaField>

  <SchemaField name="recoil_index" type="number">
    Weapon recoil index.
  </SchemaField>

  <SchemaField name="random_seed" type="number">
    Spread seed of the shot.
  </SchemaField>

  <SchemaField name="weapon_id" type="number">
    Weapon definition index.
  </SchemaField>

  <SchemaField name="weapon_mode" type="number">
    Weapon fire mode.
  </SchemaField>
</Schema>

## console\_input

Fired every time the user runs a console command. Use the parameter passed by the callback to access the input string. This can be used to implement custom console commands.

<Note>
  Return `false` to prevent the game from processing the command.
</Note>

<Expandable title="Example">
  ```lua lines=false
  local last_random_int

  events.console_input:set(function(text)
      if text == '/roll' then
          local random_int = utils.random_int(1, 6)

          local str = common.get_username() .. ' rolled a ' .. random_int
          if random_int == 1 and random_int == last_random_int then
              str = str .. '... snake eyes!'
          end

          print(str)

          last_random_int = random_int
          return false
      end
  end)
  ```
</Expandable>

## draw\_model

Fired before a model is rendered. Use the parameter passed by the callback to access the model context.

<Schema title="Callback fields">
  <SchemaField name="name" type="string">
    Name of the model (e.g. `weapons\v_knife_cord.mdl`).
  </SchemaField>

  <SchemaField name="entity" type="entity">
    Entity that belongs to the model.
  </SchemaField>

  <SchemaField name="draw" type="function">
    Draws the model with the specified material. Pass `nil` to the first argument to draw the model with the default material.
  </SchemaField>
</Schema>

<Note>
  Return `false` to prevent the game from rendering the original model.
</Note>

<Expandable title="Example">
  ```lua Draw model example lines=false
  local ct_fbi_glass = materials.get('models/player/ct_fbi/ct_fbi_glass', true)

  events.draw_model:set(function(ctx)
      local me = entity.get_local_player()

      if ctx.entity == me then
          -- Override local player model with the new material
          ctx:draw(ct_fbi_glass)

          -- Prevent the game from drawing the original model
          return false
      end
  end)
  ```
</Expandable>

## level\_init

Fired after fully connecting to the server (first non-delta packet received). (`SIGNONSTATE:FULL`)

## pre\_render

Fired before a frame is rendered. (`FrameStageNotify:FRAME_RENDER_START`)

## post\_render

Fired after a frame is rendered. (`FrameStageNotify:FRAME_RENDER_END`)

## net\_update\_start

Fired before the game processes entity updates from the server. (`FrameStageNotify:FRAME_NET_UPDATE_START`)

## net\_update\_end

Fired after an entity update packet is received from the server. (`FrameStageNotify:FRAME_NET_UPDATE_END`)

## config\_state

Fired every time the config state is updated. The current state is accessible from the callback arguments as one of these strings: `pre_save`, `post_save`, `pre_load`, `post_load`.

<Expandable title="Example">
  ```lua lines=false
  events.config_state(function(state)
      print(state == "pre_save")
  end)
  ```
</Expandable>

## mouse\_input

Fired every time mouse input occurs.

<Note>
  Return `false` to lock the mouse input.
</Note>

## shutdown

Fired when the script is about to unload.

## pre\_update\_clientside\_animation

Fired before `C_CSPlayer::UpdateClientSideAnimation` is called.

<Schema title="Callback fields">
  <SchemaField name="player" type="entity">
    The player whose clientside animation is about to update.
  </SchemaField>
</Schema>

## post\_update\_clientside\_animation

Fired after `C_CSPlayer::UpdateClientSideAnimation` is called.

<Schema title="Callback fields">
  <SchemaField name="player" type="entity">
    The player whose clientside animation has updated.
  </SchemaField>
</Schema>

## grenade\_override\_view

Invoked to override the input values for the grenade prediction. Contains detailed view parameters associated with the grenade trajectory prediction.

<Schema title="Callback fields">
  <SchemaField name="angles" type="vector">
    Input view angles.
  </SchemaField>

  <SchemaField name="src" type="vector">
    Input starting position or origin.
  </SchemaField>

  <SchemaField name="velocity" type="vector">
    Input velocity.
  </SchemaField>

  <SchemaField name="view_offset" type="vector">
    Input view offset.
  </SchemaField>
</Schema>

## grenade\_warning

Fired when the "Grenade Proximity Warning" is being rendered.

<Note>
  Return `false` to prevent it from being rendered.
</Note>

<Schema title="Callback fields">
  <SchemaField name="entity" type="entity">
    The game entity representing the grenade in proximity.
  </SchemaField>

  <SchemaField name="origin" type="vector">
    The current position of the grenade.
  </SchemaField>

  <SchemaField name="closest_point" type="vector">
    Represents the nearest point to the player where the grenade will cause damage. For example, in the case of a molotov, this point indicates where the flames would be most harmful.
  </SchemaField>

  <SchemaField name="type" type="string">
    Specifies the type of the grenade, "Frag" or "Molly".
  </SchemaField>

  <SchemaField name="damage" type="number">
    Predicts the potential damage that would be inflicted upon the local player if they remain at their current position when the grenade detonates.
  </SchemaField>

  <SchemaField name="expire_time" type="number">
    Specifies the time when the grenade detonates or is no longer a threat.
  </SchemaField>

  <SchemaField name="icon" type="texture">
    A reference to the texture used in the warning.
  </SchemaField>

  <SchemaField name="path" type="table">
    Table of 3D vectors representing the complete trajectory path of the grenade.
  </SchemaField>
</Schema>

## grenade\_prediction

Fired when the cheat is drawing the predicted grenade trajectory. Contains detailed information about the grenade's trajectory and impact.

<Schema title="Callback fields">
  <SchemaField name="type" type="string">
    Identifies the type of the grenade, e.g. "Smoke", "Flash", "Frag".
  </SchemaField>

  <SchemaField name="damage" type="number">
    Represents the amount of damage inflicted upon the `target` due to the grenade's effect.
  </SchemaField>

  <SchemaField name="fatal" type="boolean">
    Indicates whether the grenade's effect resulted in a lethal outcome for the `target`.
  </SchemaField>

  <SchemaField name="path" type="table">
    Table of 3D vectors representing the complete trajectory path of the grenade.
  </SchemaField>

  <SchemaField name="collisions" type="table">
    Table of 3D vectors containing all the collision points where the grenade interacts with an obstacle or wall.
  </SchemaField>

  <SchemaField name="target" type="entity">
    The game entity that the grenade directly impacts or affects.
  </SchemaField>
</Schema>

## localplayer\_transparency

Invoked to override the opacity of the local player's model. You can override it by returning a custom alpha value.

<Schema title="Callback fields">
  <SchemaField name="current_alpha" type="number">
    The current alpha. Ranges from 0 (completely transparent) to 255 (completely opaque).
  </SchemaField>
</Schema>

## voice\_message

Fired every time the game receives a voice packet. This is a more advanced event — the callback exposes a binary buffer you can read from, and firing it yourself lets you write a custom voice packet.

<Schema title="Callback fields">
  <SchemaField name="entity" type="entity">
    Entity that belongs to the voice packet.
  </SchemaField>

  <SchemaField name="audible_mask" type="number">
    Audible mask.
  </SchemaField>

  <SchemaField name="xuid" type="number">
    Xuid.
  </SchemaField>

  <SchemaField name="proximity" type="number">
    Proximity.
  </SchemaField>

  <SchemaField name="format" type="number">
    Format.
  </SchemaField>

  <SchemaField name="sequence_bytes" type="number">
    Sequence bytes.
  </SchemaField>

  <SchemaField name="section_number" type="number">
    Section number.
  </SchemaField>

  <SchemaField name="uncompressed_sample_offset" type="number">
    Uncompressed sample offset.
  </SchemaField>

  <SchemaField name="buffer" type="read_buffer">
    Voice packet buffer.
  </SchemaField>

  <SchemaField name="is_nl" type="boolean">
    Packet was sent by Neverlose.
  </SchemaField>
</Schema>

<Note>
  Firing this event from Lua will send a voice packet: `events.voice_message(function: buffer)`.
</Note>

<Expandable title="Example">
  ```lua lines=false
  events.voice_message(function(ctx)
      local buffer = ctx.buffer
      local code = buffer:read_bits(16)

      if code ~= 0x1337 then
          return
      end

      local tickcount = buffer:read_bits(32)

      print(string.format(
          'received voice packet from %s | pct_tickcount: %d',
          ctx.entity:get_name(), tickcount
      ))
  end)

  -- Note that you wont be able to receive your own voice packet
  -- unless voice_loopback convar is set to 1
  events.voice_message:call(function(buffer)
      buffer:write_bits(0x1337, 16)
      buffer:write_bits(globals.tickcount, 32)
  end)
  ```

  ```text lines=false
  [neverlose] received voice packet from Salvatore | pct_tickcount: 1200
  ```
</Expandable>

<AccordionGroup>
  <Accordion title="struct read_buffer">
    Binary read buffer — reads values out of the voice packet.

    <Schema>
      <SchemaField name="read_bits" type="function">
        Reads a number value from the buffer. `:read_bits(num_bits)`
      </SchemaField>

      <SchemaField name="read_coord" type="function">
        Reads a floating number value from the buffer. `:read_coord()` (4 bytes)
      </SchemaField>

      <SchemaField name="reset" type="function">
        Resets the pointer of the buffer to its original offset.
      </SchemaField>

      <SchemaField name="crypt" type="function">
        Encrypts/decrypts the buffer. `:crypt(key)`
      </SchemaField>
    </Schema>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="struct write_buffer">
    Binary write buffer — writes values into the voice packet.

    <Schema>
      <SchemaField name="write_bits" type="function">
        Writes a number value to the buffer. `:write_bits(value, num_bits)`
      </SchemaField>

      <SchemaField name="write_coord" type="function">
        Writes a floating number value to the buffer. `:write_coord(value)` (4 bytes)
      </SchemaField>

      <SchemaField name="is_overflowed" type="function">
        Returns `true` if the buffer is overflowed.
      </SchemaField>

      <SchemaField name="crypt" type="function">
        Encrypts/decrypts the buffer. `:crypt(key)`
      </SchemaField>
    </Schema>
  </Accordion>
</AccordionGroup>
