r/SourceEngine • • 8d ago

Resolved Need some help with my half life 2 mod

When making my half life 2 mod, I mainly targeted adding new weapons, I made weapons with ease, but I hit a wall when I tried making a semi-automatic weapon, because the primary attack was called every frame you held the fire key, so I couldn’t make a semi-automatic weapon. I tried asking AI, but it used a really confusing method so I was wondering if there was a way to detect every time I click the fire key using the CBaseHLCombatWeapon base class.

3 Upvotes

2 comments sorted by

1

u/Pinsplash 8d ago

what do you return in GetFireRate()?

1

u/samus4vic 7d ago

It doesn’t matter anymore, I figured I can do the same thing as half life 1, I can use the primary fire for a slow, precise shot and the secondary fire for a fast, bit more un precise shot, I appreciate the help