SA-MP Forums Archive
racing system how to take time? - 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: racing system how to take time? (/showthread.php?tid=140756)



racing system how to take time? - Cank - 10.04.2010

hi, i'm scripting a race system and i just don't know how to take the time that needs a racer from start to finish.
i want that, when someone starts the race the time starts and when a racer finishes there shuold be a message in the chat like
"<name> has finished the race in <minutes>:<seconds>:<milliseconds>".
how would you do it?


Re: racing system how to take time? - [HiC]TheKiller - 10.04.2010

Look at my race script, it should help you.


Re: racing system how to take time? - Cank - 10.04.2010

ah ok, you made it with a timer and increase a variable each second, yes?
but i want to take the time with milliseconds, so do i need a timer with an intervall of 1 millisecond, uh?


Re: racing system how to take time? - [HiC]TheKiller - 10.04.2010

Quote:
Originally Posted by Cank
ah ok, you made it with a timer and increase a variable each second, yes?
but i want to take the time with milliseconds, so do i need a timer with an intervall of 1 millisecond, uh?
Or you could make a timer in seconds then divide by 1000.


Re: racing system how to take time? - Cank - 10.04.2010

but then you cant give the time exatly in millieconds, because the function is only called one time each second, or am i wrong?
could you give a short example pls?



Re: racing system how to take time? - Jeffry - 10.04.2010

This should help you.
Helped me too.

http://forum.sa-mp.com/index.php?topic=158971.0


Re: racing system how to take time? - Cank - 10.04.2010

thank you


Re: racing system how to take time? - Jeffry - 10.04.2010

Quote:
Originally Posted by Cank
thank you
No problem.