GetTickCount
#1

Hello everyone, one quick quesion:

with this code time running from 00:00 up to 01:07 and.....

Код:
Time[playerid] = GetTickCount()+1000*60*2;
How to make that time runs out? For example from 02:00 to zero and then do something after time runs out?

with this code seems everything good, but shows "-" symbol near 00:00 time textdraw. (example: -01:17)
Код:
Time[playerid] = GetTickCount()+1000*60*2;
Reply
#2

What exactly do you want to achieve here?
Reply
#3

Quote:

Time[playerid] = GetTickCount();

this code makes time run up, example 01:12, 02:21...
I need that time run backward, from 02:21 to 01:12 and lower...
Reply
#4

anyone?
Reply
#5

you can't backward that GetTickCount directly.
but u can backward Time <- variable, with timers or next code maybe.
Time[playerid] = GetTickCount(); (for first)
and than
Time[playerid] = GetTickCount()-Time[playerid];
looping this func.

but I dont know if this will work, n/a tried before
Reply
#6

You must calculate the time passed between the start of the timer and now.
eg. timepassed = GetTickCount() - TimeStamp[playerid];

Then subtract this time from the total time (eg 120000 - timepassed). That will result in the time remaining until the timer runs out. That will be in ms so you must convert it to seconds and minutes.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)