We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 020999b commit 6fd4f47Copy full SHA for 6fd4f47
pkg/demoinfocs/common/player.go
@@ -175,6 +175,21 @@ func (p *Player) Weapons() []*Equipment {
175
return res
176
}
177
178
+// FlashbangCount returns the amount of flashbangs the player currently has in his inventory.
179
+func (p *Player) FlashbangCount() uint64 {
180
+ pawn := p.PlayerPawnEntity()
181
+ if pawn == nil {
182
+ return 0
183
+ }
184
+
185
+ flashCountProp, ok := pawn.PropertyValue("m_pWeaponServices.m_iAmmo.0014")
186
+ if !ok {
187
188
189
190
+ return flashCountProp.UInt64()
191
+}
192
193
// IsSpottedBy returns true if the player has been spotted by the other player.
194
// This is NOT "Line of Sight" / FOV - look up "CSGO TraceRay" for that.
195
// May not behave as expected with multiple spotters.
0 commit comments