Raised This Month: $ Target: $400
 0% 

Cumulative Timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-15-2022 , 07:13   Re: Cumulative Timer
Reply With Quote #7

I would create a single timer of 1.0 seconds and do a loop through all clients where AbilityStart[client] = true

PHP Code:
if (f_AbilityStart[client] > 0.0 && GetGameTime() - f_AbilityStart[client] > 10.0)
    
AbilityStart[client] = false 
anyway, this is HOW I would do it, is not the most effective way but is easier to maintain.

also don't forget to reset on player death, round restart, etc

There are a lot of plugins with similar cooldown features, just need to search a bit and check their code.
__________________
Marttt is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode