07.06.2013, 01:45
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
GetTimeMS() then gives you the approximated current system time millisecond component.
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);
}
}