milliseconds for gettime
#7

Either do seconds*1000 if you just need the ms value. Or tickcount()%1000 if you just need some millisecond value. Or use some surprisingly ugly code to synchronize tickcount with the system time.

Something like this
pawn Код:
#define GetTimeMS() ((GetTickCount() % 1000)-global_syncvalue)
new global_synctimer;
new global_syncvalue;
//In OnGamemodeInit:
new h,m;
gettime(h, m, global_syncvalue);
global_synctimer = SetTimer("TickSync", 10, 1);

//Somewhere
forward TickSync();
public TickSync() {
    new h,m,s;
    gettime(h, m, s);
    // Approximates the millisecond time when GetTime goes up a second
    if (s != global_syncvalue) {
        global_syncvalue = GetTickCount()%1000-100;
        KillTimer(global_synctimer);
    }
}
GetTimeMS() then gives you the approximated current system time millisecond component.
Reply


Messages In This Thread
milliseconds for gettime - by Tanush123 - 07.06.2013, 00:06
Re: milliseconds for gettime - by Scenario - 07.06.2013, 00:21
Re: milliseconds for gettime - by eblood1 - 07.06.2013, 00:21
Re: milliseconds for gettime - by MP2 - 07.06.2013, 00:29
Re: milliseconds for gettime - by Tanush123 - 07.06.2013, 01:22
Re: milliseconds for gettime - by Richie© - 07.06.2013, 01:42
Re: milliseconds for gettime - by Mauzen - 07.06.2013, 01:45
Re: milliseconds for gettime - by Tanush123 - 07.06.2013, 02:51
Re: milliseconds for gettime - by MP2 - 12.06.2013, 17:06
Re: milliseconds for gettime - by Tanush123 - 13.06.2013, 01:47

Forum Jump:


Users browsing this thread: 1 Guest(s)