GetTickCount
#1

I have this /stopwatch command but GetTickCount returns in millseconds. Anyway to change it from millseconds to seconds?
Reply
#2

If you search somewhere there is a useful snippet or something that converts milliseconds to seconds.
Reply
#3

Im not sure but try to add *1000 beacuse 1sec is 1000ms
Reply
#4

Divide by 1000, don't multiply.
Reply
#5

Just add *1000


10*1000 = 10 seconds
Reply
#6

Like..
pawn Код:
format(string, 256, "You have stopped the stopwatch on %s. The time was %i",giveplayer, GetTickCount() - stopwatchtime/1000);
?
Reply
#7

I'd use a float so it's 1.234 seconds instead of 1 second

pawn Код:
format(string, 256, "You have stopped the stopwatch on %s. The time was %f",giveplayer, GetTickCount() - stopwatchtime/1000);
Reply
#8

I tried it but for some reason it didn't do anything :/ Just said 0.000000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)