remaining round time
Could anyone suggest me a best method to get remaining round time in seconds? (counter-strike mod)
|
Re: remaining round time
I believe to do this you would have to:
1.) Hook when the round starts. 2.) Set a task to count how many seconds it is into the round. 3.) Subtract the seconds into the round from the mp_roundtime cvar. |
Re: remaining round time
The mp_roundtime is set to 1.75,when the round starts,timer at the bottom of the screen, shows 1.45,so if i do as u mentioned in 3., things can go wrong
isnt that true? ... soo... the question is how to convert 1.75 from mp_roundtime to real 1.45 = 105 seconds ... okay :D 1.75 * 60 /////////////// Will that work? new roundtime = floatround(floatmul(get_cvar_float("mp_roundt ime"), 60.0)) |
Re: remaining round time
This will print each seconds and to every player how many seconds are remaining :
Code:
|
Re: remaining round time
set_task() is never the right choice for counting seconds. Your snippet seems correct. You could use get_systime() at the start of each round and then again at the time of calculation.
Code:
|
Re: remaining round time
You're right about get_systime that's better than set_task.
I wonder what is better to use, get_gametime or get_systime... (except the fact that one is Float). But considering that mp_roundtime can be changed by an admin after the begining of a round, i think it's better to use a global and to set it each begining of round. I think that this should do the trick : Code:
|
| All times are GMT -4. The time now is 16:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.