SA-MP Forums Archive
yrace0.4 Time problem!! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: yrace0.4 Time problem!! (/showthread.php?tid=166584)



yrace0.4 Time problem!! - caldaia33 - 09.08.2010

Hi, i have a problem with the y race script.
The displayed showed to the player when a race end is uncorrect.

When the script say the race time it says x : x .xx when it should say x : xx .x ...how i can fix that??

I THINK the problem is in this piece of code...but I'M NOT SURE

BeHuman(ticks)
{
new HumanTime[10], minutes, seconds, secstring[2], msecstring[3];
minutes=ticks/60000;
ticks=ticks-(minutes*60000);
seconds=ticks/1000;
ticks=ticks-(seconds*1000);
if(seconds <10) format(secstring,sizeof(secstring),"0%d",seconds);
else format(secstring,sizeof(secstring),"%d",seconds);
format(HumanTime,sizeof(HumanTime),"%d:%s",minutes ,secstring);
if(ticks < 10) format(msecstring,sizeof(msecstring),"00%d", ticks);
else if(ticks < 100) format(msecstring,sizeof(msecstring),"0%d",ticks);
else format(msecstring,sizeof(msecstring),"%d",ticks);
format(HumanTime,sizeof(HumanTime),"%s.%s",HumanTi me,msecstring);
return HumanTime;
}

please someone help me D: !!!


Re: yrace0.4 Time problem!! - FireCat - 09.08.2010

but why did u change it, when i used it i thought it was awesome.


Re: yrace0.4 Time problem!! - caldaia33 - 09.08.2010

For me the displayed time are not the right one (i didn't change anything!!)
In the 0.2x the time was ok, and actually with the 0.3x the displayed time is wrong!


Re: yrace0.4 Time problem!! - deskect - 10.08.2010

up! i have the same problem, im trying to fix it but... its not easy for me.. i didnt learn enough pawno yet

if someone could do it.. please


Re: yrace0.4 Time problem!! - deskect - 10.08.2010

okey... i just fixed it.. try with this code:

Код:
BeHuman(ticks)
{
	new HumanTime[6], minutes, seconds, secstring[2], msecstring[2];
	minutes=ticks/60000;
	ticks=ticks-(minutes*60000);
	seconds=ticks/1000;
	ticks=ticks-(seconds*1000);
	if(seconds <10) format(secstring,sizeof(secstring),"0%d",seconds);
	else format(secstring,sizeof(secstring),"%d",seconds);
	format(HumanTime,sizeof(HumanTime),"%d:%s",minutes,secstring);
	if(ticks < 10) format(msecstring,sizeof(msecstring),"00%d", ticks);
	else if(ticks < 60) format(msecstring,sizeof(msecstring),"0%d",ticks);
	else format(msecstring,sizeof(msecstring),"%d",ticks);
	format(HumanTime,sizeof(HumanTime),"%s%s",HumanTime,msecstring);
	return HumanTime;
}
please, tell me if it works for you