Highscore
#10

have the same problem, i tried to use gettick and GetTickCount (both the same on windows) and after this to convert the time into min,sec,milisec, but i always return 0, example:

0:0.0

pawn Code:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    new time = 0;
    if(CURRENTCP[playerid] == 1)
    {
        time = GetTickCount();
    }
    RaceInfo[Checkpoints] = dini_Int("/Races/CurrentRace.txt","Checkpoints");
    new MAXRACECPS = RaceInfo[Checkpoints];
   
    if(CURRENTCP[playerid] == MAXRACECPS)
    {
        new min1,sec,milis;
      ConvertTime(time,min1,sec,milis);
      DisablePlayerRaceCheckpoint(playerid);
        new name[24],string[128];
      GetPlayerName(playerid,name,24);
      format(string,128,"%s finished first :O(%d:%d.%d)",name,min1,sec,milis);
      SendClientMessage(playerid,THIAZ_YELLOW,string);
      PlayerPlaySound(playerid, 1076, 0.0, 0.0, 0.0);
     
    }
pawn Code:
stock ConvertTime(time, &minutes, &seconds, &milliseconds)
{
    for(new i; i<1000; i++) {
    if(time >= 1000) {
      time = time-1000;
      seconds++;
      if(seconds == 60) {
        seconds = 0;
        minutes++;
      }
    }else{
      milliseconds = time;
      break;
    }
  }
}
need help,

greetz
Reply


Messages In This Thread
Highscore - by Ribber - 14.04.2009, 20:44
Re: Highscore - by Ribber - 14.04.2009, 22:25
Re: Highscore - by Ribber - 15.04.2009, 00:05
Re: Highscore - by Sandra18[NL] - 15.04.2009, 00:24
Re: Highscore - by Ribber - 15.04.2009, 00:44
Re: Highscore - by Backwardsman97 - 15.04.2009, 00:47
Re: Highscore - by Ribber - 15.04.2009, 00:55
Re: Highscore - by Ribber - 15.04.2009, 10:20
Re: Highscore - by Ribber - 15.04.2009, 12:56
Re: Highscore - by thiaZ_ - 07.12.2009, 19:48

Forum Jump:


Users browsing this thread: 1 Guest(s)