View Single Post
Hn.S Xmix
Member
Join Date: May 2021
Old 05-04-2024 , 11:39   Re: Duration & Cooldown
Reply With Quote #5

Quote:
Originally Posted by v120kaaimcfg View Post
They don't stop "counting", they just don't appear on the HUD anymore. The first frame the player is IN_USE or IN_DUCK+IN_JUMP the plugin calculates values for last use time and next use time which are respectively controlled by the two cvars zp_wallclimb_cooldown && zp_wallclimb_duration:
1. Player has the climb skill ready to go
2. Player uses IN_USE button/IN_DUCK+IN_JUMP
3. variables for till when he can use the skill (g_lastusetime[id]) and when the next time he'll be able to use the skill after the last use time expires (g_nextuse[id]) are calculated
4. player can use the skill whenever he wants in the time period between his first use of the skill and the last set time. After that time expires the skill goes into cooldown for the set amount of time until the cooldown expires and the cycle repeats.

Basically the player only controls when to start the countdown for his 10 second climb skill usage(that's what I understood from the code you gave). The HUD is merely informative. You can edit it in any way you want to.

Yes you're right everything you said is true i should pay more attention. I test it again right now and it works exactly as you said, i can barely understand the codes its not that complicated

But there is 2 small and tiny problems
..

1-Duration will start immediately if the player press KEY_USE in the air without even facing walls
2-if player stop holding KEY_USE the cooldown will not start deliberately it will wait until duration end so the player can climb again at that time

Is it possible to fix it? My requesting are just too much bcs this plugin is very important in my server
Hn.S Xmix is offline