c_base_combat_weapon
Represents a combat weapon in CS:GO. Provides access to weapon state, timing, ammunition, and accuracy calculations. Source:game/sdk/classes/c_base_combat_weapon.h:10
Inherits: c_base_entity
Network Variables
Server time when the weapon can fire its next primary attackNetvar:
CBaseCombatWeapon::m_flNextPrimaryAttackServer time when the weapon can fire its next secondary attackNetvar:
CBaseCombatWeapon::m_flNextSecondaryAttackCurrent ammunition in the weapon’s magazine/clipNetvar:
CBaseCombatWeapon::m_iClip1Reserve ammunition count for primary fireNetvar:
CBaseCombatWeapon::m_iPrimaryReserveAmmoCountModel index for the first-person view modelNetvar:
CBaseCombatWeapon::m_iViewModelIndexModel index for the third-person world modelNetvar:
CBaseCombatWeapon::m_iWorldModelIndexModel index when weapon is dropped in the worldNetvar:
CBaseCombatWeapon::m_iWorldDroppedModelIndexTime when postponed fire will be readyNetvar:
CBaseCombatWeapon::m_flPostponeFireReadyTimeHandle to the weapon’s world view model entityNetvar:
CBaseCombatWeapon::m_hWeaponWorldModelWeapon definition index (identifies weapon type)Netvar:
CBaseAttributableItem::m_iItemDefinitionIndexMethods
Retrieves the weapon’s static data including damage, range, and accuracy valuesReturns: Pointer to weapon data structure, or
nullptr if unavailableVirtual Index: 461Calculates current weapon inaccuracy value based on movement, stance, and other factorsReturns: Inaccuracy value (higher = less accurate)Virtual Index: 483
Calculates current weapon spread valueReturns: Spread valueVirtual Index: 453
Generates a random spread vector for bullet trajectory calculationParameters:
seed- Random seed for reproducibilityinaccuracy- Inaccuracy valuespread- Spread value
Checks if the weapon can fire primary attackReturns:
true if primary fire is availableImplementation defined externally
Checks if the weapon can fire secondary attackReturns:
true if secondary fire is availableImplementation defined externally
weapon_data_t
Static weapon configuration data structure. Source:game/sdk/structs/weapon_data_t.h
Common Fields
Base damage dealt by the weapon
Number of bullets fired per shot (typically 1, or 9 for shotguns)
Maximum effective range of the weapon
Damage falloff modifier over distance
Penetration power through surfaces