SA-MP Forums Archive
GetTickCount - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetTickCount (/showthread.php?tid=649590)



GetTickCount - Zaec - 11.02.2018

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;



Re: GetTickCount - iKarim - 11.02.2018

What exactly do you want to achieve here?


Re: GetTickCount - Zaec - 11.02.2018

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...


Re: GetTickCount - Zaec - 11.02.2018

anyone?


Re: GetTickCount - Mugala - 11.02.2018

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


Re: GetTickCount - NaS - 12.02.2018

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.