AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finding miliseconds on prokreedz problem... (https://forums.alliedmods.net/showthread.php?t=121821)

NucL3ra 03-20-2010 08:46

Finding miliseconds on prokreedz problem...
 
I tried for about 2 days to find out this problem and as usual I'm going to ask for your help...

This is the code for finish time

PHP Code:

if((equal(entname,"counter_off") || equal(entname,"clockstopbutton") || equal(entname,"clockstop")) && timer_started[id-1]) {
new 
name[32]
get_user_name(id,name,32)
new 
kreedztime get_systime() - timer_time[id-1]
new 
imin floatround(kreedztime 60.0,floatround_floor)
new 
isec floatround(kreedztime imin 60.0,floatround_floor)
new 
ims floatround( ( kreedztime - ( imin 60.0 isec ) ) * 100floatround_floor )
if (
isec >= 10)
   
ColorChat(0GREEN"[Kreedz]^x01 %s finished the map in^x03 %d:%d.%02i ^x01(%d CP%s)",name,imin,isec,checkpointnum[id-1],checkpointnum[id-1] == "" "s",ims)
if (
isec 9)
   
ColorChat(0GREEN"[Kreedz]^x01 %s finished the map in^x03 %d:0%d.%02i ^x01(%d CP%s)",name,imin,isec,checkpointnum[id-1],checkpointnum[id-1] == "" "s",ims)
timer_started[id-1] = false
if (checkpointnum[id-1] > 0)
     
topten_update(id)
 else 
     
proten_update(id)
            
  } 

I have no error, but the milisecond never go over 00. It's 00:01.00 , 00:02,00 (always it's 00 on ms... and i can't find how to "turn them on")

xPaw 03-20-2010 09:35

Re: Finding miliseconds on prokreedz problem...
 
Because prokreedz uses set_task wich is totally inaccurate

NucL3ra 03-20-2010 16:36

Re: Finding miliseconds on prokreedz problem...
 
1 Attachment(s)
And isn't there any possibility you could adjust your xj_timer to this prokreedz i uploaded?

Or give me some clues , because i don't know what to delete and what to keep...

Also i don't need to add miliseconds to that Hud-Messaged showing time (just MM:SS there). I need mili seconds for end time and top15 update

NucL3ra 03-22-2010 15:11

Re: Finding miliseconds on prokreedz problem...
 
Off:I didn't spam , i just asked him to stop spamming :D

On: Any help ? Exolent, instead of deleting messages how about helping a few :P
Any idea is welcomed

Exolent[jNr] 03-22-2010 15:50

Re: Finding miliseconds on prokreedz problem...
 
Your problem is that you use get_systime() which does not return any milliseconds.
Therefore, you won't get any milliseconds results.

NucL3ra 03-22-2010 20:26

Re: Finding miliseconds on prokreedz problem...
 
so i should use get_gametime () (as kz-arg does?)

NucL3ra 03-23-2010 18:42

Re: Finding miliseconds on prokreedz problem...
 
Ok, after 3 hours of editing i solved 1/2 of the problem. At the end of the climb it shows me real time (according to kz-arg and xj_timer ,both were ON). But the top 15 is broken now. It shows me really annoying values. Any idea how to fix it?

Example: i finish the map in 00:06.41 and the top15 shows me ... "nucLeaR" "1269384168"

...

I uploaded the code

NucL3ra 03-24-2010 22:13

Re: Finding miliseconds on prokreedz problem...
 
Ok, i finished 1/2 of the top 15 problem. It saves good now but i can only read minutes and seconds, and if i make a Float variable for kz time i get some freaky errors.. so i can save the times in this format:

Full time is 1:05.55 , it saves me 65.55


The question is: How to read the top15 in mm:ss.msms

hlstriker 03-24-2010 22:30

Re: Finding miliseconds on prokreedz problem...
 
If you are saving/loading as a float you can use this:

PHP Code:

// The time you saved/loaded
new Float:yourTime;

// Format time
new nowhourminutesecondmilisecond;

now floatround(yourTimefloatround_floor);
hour = (now 3600) % 24;
minute = (now 60) % 60;
second now 60;
milisecond floatround(floatsub(yourTimefloat(now)) * 100floatround_floor); 


Ryokin 03-25-2010 00:36

Re: Finding miliseconds on prokreedz problem...
 
Can you make prize for finishing map like kz-arg ?


All times are GMT -4. The time now is 08:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.