Event Reference The CS2 game events plugins use most, with their fields and types as the game defines them.
The fields below are taken from the event definitions CS2 ships in its VPKs —
resource/core.gameevents (engine), resource/game.gameevents and
resource/mod.gameevents (Counter-Strike). Where an event is defined in more
than one file, the most specific definition is listed — mod over game over
core. Names are case sensitive.
For hooking, reading and firing, see Game events .
Type in the definition Read with player_controller_and_pawnGetPlayerController(key), GetPlayerPawn(key), GetPlayerSlot(key)player_controllerGetPlayerController(key), GetPlayerSlot(key) — the pawn through the controllerplayer_pawnGetPlayerPawn(key)boolGetBool(key)byte, short, longGetInt(key)floatGetFloat(key)stringGetString(key)uint64GetUint64(key)
Player getters return a CEntityInstance*; static_cast it to
CCSPlayerController* / CCSPlayerPawn* and check for nullptr. In a script
they return the typed handle; check it against NULL_ENTITY.
auto* pController = static_cast< CCSPlayerController *> (event-> GetPlayerController ( "userid" ));
CCSPlayerPawn * pPawn = pController ? pController-> GetPlayerPawn () : nullptr ; CCSPlayerController controller = event. GetPlayerController ( "userid" );
CCSPlayerPawn pawn = controller != NULL_ENTITY ? controller. GetPlayerPawn () : NULL_ENTITY;
A client connected (before it is in the game).
Field Type namestring player name useridplayer_controller networkidstring network (Steam) id xuiduint64 SteamID64 botbool
The client finished the connection sequence — the usual "player joined" hook.
Field Type useridplayer_controller
Field Type useridplayer_controller reasonshort disconnect reason (ENetworkDisconnectionReason value) namestring networkidstring xuiduint64 SteamID64 PlayerIDshort ever_fully_connectedbool whether the player ever reached player_connect_full
A player changed team.
Field Type useridplayer_controller_and_pawn teambyte new team (ETeam: 1 spectator, 2 T, 3 CT) oldteambyte previous team disconnectbool the change is because the player disconnected silentbool isbotbool
Field Type useridplayer_controller_and_pawn
Field Type useridplayer_controller_and_pawn victim attackerplayer_controller_and_pawn killer assisterplayer_controller_and_pawn assisting player assistedflashbool the assist was a flash weaponstring weapon name the killer used weapon_itemidstring weapon_fauxitemidstring weapon_originalowner_xuidstring headshotbool dominatedshort revengeshort wipeshort squad wipe penetratedshort objects penetrated by the shot noreplaybool noscopebool thrusmokebool shot through smoke attackerblindbool attacker was flashed distancefloat distance to the victim, in metres dmg_healthshort dmg_armorbyte hitgroupbyte EHitGroup valueattackerinairbool
Field Type useridplayer_controller_and_pawn victim attackerplayer_controller_and_pawn healthbyte health left armorbyte armour left weaponstring dmg_healthshort damage to health dmg_armorbyte damage to armour hitgroupbyte EHitGroup value
player_hurt reports damage that was dealt. To change or prevent damage, hook
the damage function instead (see Hooking ).
Field Type useridplayer_controller
Field Type useridplayer_controller the flashed player attackerplayer_controller who threw the flash entityidshort the flashbang blind_durationfloat
Field Type useridplayer_controller oldnamestring newnamestring
Field Type useridplayer_controller_and_pawn slotshort
No fields. Sent before and after all other round restart actions.
Field Type timelimitlong round time limit, seconds fraglimitlong objectivestring
No fields. Freeze time is over, players can move.
Field Type winnerbyte winning team (ETeam) reasonbyte round end reason messagestring end-of-round message legacybyte player_countshort players alive at the end of the round nomusicbyte don't play round end music
Field Type useridplayer_controller reasonshort valuelong musickitmvpslong nomusicbyte musickitidlong
No fields.
Event Fields bomb_beginplantuserid (player_controller_and_pawn), site (short)bomb_planteduserid (player_controller_and_pawn), site (short), c4 (short)bomb_begindefuseuserid (player_controller_and_pawn), haskit (bool)bomb_defuseduserid (player_controller_and_pawn), site (short), c4 (short)bomb_explodeduserid (player_controller_and_pawn, the planter), site (short), c4 (short)bomb_droppeduserid (player_controller_and_pawn), entindex (long)bomb_pickupuserid (player_pawn)player_given_c4userid (player_controller)
Event Fields weapon_fireuserid (player_controller_and_pawn), weapon (string), silenced (bool)weapon_reloaduserid (player_controller_and_pawn)weapon_zoomuserid (player_controller_and_pawn)bullet_impactuserid (player_controller_and_pawn), x, y, z (float)item_purchaseuserid (player_controller), team (short), loadout (short), weapon (string)item_pickupuserid (player_controller), item (string), silent (bool), defindex (long)item_equipuserid (player_controller), item (string), defindex (long), canzoom, hassilencer, issilenced, hastracers (bool), weptype (short), ispainted (bool)
item_equip.weptype: -1 unknown, 0 knife, 1 pistol, 2 SMG, 3 rifle, 4 shotgun,
5 sniper rifle, 6 machine gun, 7 C4, 8 grenade.
Event Fields grenade_thrownuserid (player_controller_and_pawn), weapon (string)hegrenade_detonateuserid (player_controller_and_pawn), entityid (short), x, y, z (float)flashbang_detonateuserid (player_controller_and_pawn), entityid (short), x, y, z (float)smokegrenade_detonateuserid (player_controller_and_pawn), entityid (short), x, y, z (float)
Event Fields game_newmapmapname (string) — sent when a new map has finished loadingserver_cvarcvarname (string), cvarvalue (string)
Some events exist to drive the client UI and are useful with
FireEventToClient:
Event Fields Use show_survival_respawn_statusloc_token (string), duration (long), userid (player_controller_and_pawn)HTML text in the centre of the screen — what CCSPlayerController::PrintToCenterHtml sends.
The full definitions are plain text inside the game's VPKs:
game/csgo/pak01_dir.vpk → resource/game.gameevents and
resource/mod.gameevents, game/core/pak01_dir.vpk →
resource/core.gameevents. Any VPK tool can open them. To see what fires in
practice, hook the candidates with a post hook that logs event->GetName().