SetTimerEx
#7

You can actually use GetTickCount() to calculate the remaining time without using any timers at all.

Example:
pawn Код:
// When you've triggered some event, for example picking up a pickup
my_time = GetTickCount();

// Check, if something has expired, for example the player is allowed to pick a pickup again (5000 means 5000 milliseconds, also 5 seconds)
if(GetTickCount() >= my_time+5000)
{
}

// Calculate the remaining time in milliseconds
remaining_time = (my_time+5000)-GetTickCount();
Also you should check, if your time variable has been ever set, before checking it for being expired or calculating the remaining time.
Reply


Messages In This Thread
SetTimerEx - by CesarLT - 22.09.2013, 23:03
Re: SetTimerEx - by DanishHaq - 22.09.2013, 23:07
Re: SetTimerEx - by CesarLT - 22.09.2013, 23:09
Re: SetTimerEx - by jakejohnsonusa - 23.09.2013, 01:05
Re: SetTimerEx - by CesarLT - 23.09.2013, 01:46
Re: SetTimerEx - by jakejohnsonusa - 23.09.2013, 01:51
AW: SetTimerEx - by BigETI - 23.09.2013, 03:49
Re: SetTimerEx - by CesarLT - 23.09.2013, 09:46

Forum Jump:


Users browsing this thread: 1 Guest(s)