[Tutorial] Cooldowns (No timers)
#3

I saw one of Emmet_'s source code and noticed him making use of a function called NetStats_GetConnectedTime.

https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime

That can be a substitute for gettime(), handy if you run your server past 2038 lol. And also perhaps uses less resource (just my assumption).

It's an detailed tutorial. Nice. Only thing I can suggest is to format it nicely and make it more simple (less text).

pawn Code:
if( currenttime < HealCooldown[ playerid ] )
    // return w.e

HealCooldown[ playerid ] = gettime( ) + 30;
I would do it like that honestly so that you don't need to be adding 30 seconds in every client message you use. You can straight off just subtract the current timestamp from thereon.
Reply


Messages In This Thread
Cooldowns (No timers) - by TwinkiDaBoss - 27.07.2015, 00:07
Re: Cooldowns (No timers) - by $$inSane - 27.07.2015, 10:43
Re: Cooldowns (No timers) - by Lorenc_ - 27.07.2015, 10:50
Re: Cooldowns (No timers) - by TwinkiDaBoss - 27.07.2015, 12:08
Re: Cooldowns (No timers) - by !damo!spiderman - 27.07.2015, 12:56
Re: Cooldowns (No timers) - by TwinkiDaBoss - 27.07.2015, 13:11
Re: Cooldowns (No timers) - by Skillex333 - 27.07.2015, 15:38
Re: Cooldowns (No timers) - by TwinkiDaBoss - 27.07.2015, 21:20

Forum Jump:


Users browsing this thread: 1 Guest(s)