Reloading Bar

Hello there,

I want to make a processing bar that only shows when the player is reloading.
So when a player reloads a bar pops up and it’s filling it self.
And then dissapear when the player is done with reloading.

Someone can help me with this?

Thank you!
Love love!

I think you need to hook into

GM:DoAnimationEvent, check if the event is PLAYERANIMEVENT_RELOAD, and then use

Entity:SequenceDuration

Unfortunately, it’s not exactly easy since there is no “OnWeaponReloaded” hook, and it depends on each weapon’s implementation of reloading. You could make it work for HL2 weapons by constantly checking the viewmodel sequence with

Entity:GetSequence for ACT_VM_RELOAD with

Entity:GetSequenceActivity, and then use

Entity:GetCycle on the viewmodel for progress.

[editline]2nd September 2017[/editline]

That’s only for player third-person reloading sequences, which don’t use the same timing as first-person sequences. First-person/viewmodel is what’s used to tell if the player can fire again.