[Include] Counters
#1

__________________________________________________ __________________________________________________

Download here!
__________________________________________________ __________________________________________________

Description:
In the past, I was tired of seeing people over use timers for small tasks. I made this short library (well, a super simple version of it, see github initial commit) and forgot about it. Then I seen UltraScripter's US_Timers library. His is OK, but it is a good example of over-used timers. I told him about my old library and he said he'd like to see it. So that's when I dug it up. I told him I'd like to release it but it's not a competition and he said he didn't care, now I'm here. There is an example script on the git on how to use it but it's pretty simple.

Requirements:
YSI 3 or 4 (preferably 4).
__________________________________________________ __________________________________________________

Current Functions:
pawn Код:
StartPlayerCounter(playerid, pc_CounterMode:countermode = COUNTER_MODE_SECONDS)
    //Start counting. Modes - COUNTER_MODE_SECONDS, COUNTER_MODE_MINUTES.
StopPlayerCounter(playerid, counterid)
    //Stop counting, not needed but should be used when resetting counters.
GetPlayerCounterTime(playerid, counterid)
    //Return time since the counter started (unit depends on mode).
IsValidPlayerCounter(playerid, counterid)
    //Validate a counter.

// Global functions. All of these are the same as the player functions but globally.
StartCounter(pc_CounterMode:countermode = COUNTER_MODE_SECONDS)
StopCounter(counterid)
GetCounterTime(counterid)
IsValidCounter(counterid)

ConvertSeconds(unix, &secs, &mins, &hours)
    //Just an extra function to convert seconds to seconds, minutes, and hours.
__________________________________________________ __________________________________________________

Known Issues:
  • None so far.
Reply


Messages In This Thread
Counters - by Crayder - 27.08.2015, 00:34
Re: Counters - by ThePhenix - 27.08.2015, 00:50
Re: Counters - by Crayder - 27.08.2015, 01:22
Re: Counters - by ThePhenix - 27.08.2015, 01:31
Re: Counters - by Dayvison_ - 27.08.2015, 01:55
Re: Counters - by ExTaZZ69 - 27.08.2015, 06:54
Re: Counters - by Yashas - 27.08.2015, 15:34
Re : Re: Counters - by AlexBlack - 27.08.2015, 15:41
Re: Counters - by PT - 27.08.2015, 17:39
Re: Counters - by Crayder - 27.08.2015, 20:16
Re: Counters - by Evocator - 27.08.2015, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)