time left in a round
hello, i have searched for a function to get the time left in a round, in http://www.amxmodx.org/funcwiki.php, and didn't find it.
is there another place where can i find it or can someone tell me witch one is it? thx |
Re: time left in a round
There isn't.
You have to code it yourself. |
Re: time left in a round
get_cvar_num("amx_timeleft")
|
Re: time left in a round
Wilson... ownd :)
|
Re: time left in a round
3 Attachment(s)
Quote:
I've made a plugin you can use. Install the plugin, then you can use the native get_remaining_seconds() in all plugins you want. You have to put the .inc file in scripting/includes/ folder in order to compile plugins using the native. You also have to declare my plugin before other plugins that will use the native. get_remaining_seconds() will return : - negative values during freezetime - remaining seconds before round end during a round - remaining seconds before the bomb explose once bomb is planted - 0 during round end or when a restart has been triggered |
Re: time left in a round
thank you very much!
so i`ll need to run you`re plugin for other plugins to use this native? one more thing, where can i learn how to do this so i won`t ask somebody else how to code my own native? |
Re: time left in a round
Code:
This could help you if you want to spare some lines. You can also replace halflife_time by get_systime function to get less precise integer result. Round_time_left should return round time left in seconds. |
Re: time left in a round
I wish it would be so easy, but in fact you have to store mp_roundtime at newround event, because it can be change during the round by an admin or a plugin, so your way will give bad results.
You also have to deal with freezetime, so the round begins at roundstart event and not newround as you did. Last thing is halflife_time need engine module. get_systime return integer that make results less accurate. |
Re: time left in a round
Oh! Timeleft in a round!
In my country, dayofdefeatia, we don't have rounds. I read right past it. :P |
Re: time left in a round
In that case, get_timeleft() should do it
|
All times are GMT -4. The time now is 20:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.