Can't convert time normally..
#1

I'm trying to get ex: 1:28.587 , min: sec.ms

pawn Код:
TimeNX = timestamp - RaceTick;
                ConvertTime(var,TimeNX, rTime[0], rTime[1], rTime[2]);
                if (rTime[1] < 10)format(sSeconds, sizeof(sSeconds), "0%d", rTime[1]);
                else format(sSeconds, sizeof(sSeconds), "%d", rTime[1]);
                if (rTime[2] < 100)format(sMSeconds, sizeof(sMSeconds), "0%d", rTime[2]);
                else format(sMSeconds, sizeof(sMSeconds), "%d", rTime[2]);
                format(string,sizeof(string),"%d:%d.%d",rTime[0],sSeconds,sMSeconds);
SendClientMessage(playerid,COLOR_WHITE,string);
thats the code im trying to use. i Put up a RaceTick=GetTickCount(); when the race starts. on race stop its 0. But it displays not correct time. I putted up additional timer which calculates only seconds and like i get 0:21 with timer, with this it wrote: 0:50:981, i don't even know why ir wrote like that. Can anyone explain to me what do i need to do more?
Reply


Messages In This Thread
Can't convert time normally.. - by 0ne - 06.12.2010, 17:11
Re: Can't convert time normally.. - by 0ne - 07.12.2010, 13:32

Forum Jump:


Users browsing this thread: 1 Guest(s)