Raised This Month: $28 Target: $400
 7% 

how to get and set the value of Round Timer


Post New Thread Reply   
 
Thread Tools Display Modes
Dark Hacker
Member
Join Date: Jun 2024
Old 08-05-2024 , 03:15   Re: how to get and set the value of Round Timer
Reply With Quote #11

Quote:
Originally Posted by v120kaaimcfg View Post
Make the round infinite with mp_round_infinite and set mp_roundtime to a number higher than your_roundtime_cvar(doesn't hurt to be double safe).
Every round start get your_roundtime_cvar value in a global var and create a repeating "b" task with 1.0 sec interval.
Each task call decrement(--) the global var and send a "RoundTime" msg to all players with the global var as the time.
When your global var becomes <= 0 end the round with rg_round_end or a similar function.
This way you'll have "full" control over the round time and you can call any functions whenever during the round.
There could be some visual glitches in the roundtime hud but it'll work.
Seems like a roundabout way of doing it but I can't find a better way so feel free to explore/wait for other replies.

I did that:
Code:
public plugin_init(){
       register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public event_round_start()
{
       new Float:first_count = get_cvar_float("mp_freezetime")
       new Float:round_minutes = get_cvar_float("mp_roundtime")
       new Float:seconds_per_minutes = 60.0
       set_task(first_count +  round_minutes * seconds_per_minutes, "task_end_game", TASK_CHECKEND)
}
Dark Hacker is offline
Old 08-05-2024, 07:36
v120kaaimcfg
This message has been deleted by v120kaaimcfg.
Jhob94
AMX Mod X Moderator
Join Date: Jul 2012
Old 08-05-2024 , 07:41   Re: how to get and set the value of Round Timer
Reply With Quote #12

I was talking about this message https://wiki.alliedmods.net/index.ph...ents#RoundTime

Anyway forget everything that you are thinking and do what i told you. Remove gamemaster and use orpheu/regame depending if you running hlds/rehlds
__________________
My Plugins List | My Tutorials List
Everything that i know was self-learned with the help of this community
If you want to thank me for my plugins
donate to alliedmodders
Jhob94 is offline
Dark Hacker
Member
Join Date: Jun 2024
Old 08-05-2024 , 07:44   Re: how to get and set the value of Round Timer
Reply With Quote #13

Quote:
Originally Posted by v120kaaimcfg View Post
well yeah just add
Code:
remove_task(TASK_CHECKEND)
at the start of event_round_start() and all's good? That's probably why it sometimes ends 3-4 seconds before the actual round ends. Restarting the round without removing the task will result in 2 tasks running next round.
Yes bro. I wrote remove_task() function to begining of event round start() and then i started new task. My timer is working but sometimes its time isn't equal real timer hud
Dark Hacker is offline
Dark Hacker
Member
Join Date: Jun 2024
Old 08-05-2024 , 07:46   Re: how to get and set the value of Round Timer
Reply With Quote #14

Quote:
Originally Posted by Jhob94 View Post
I was talking about this message https://wiki.alliedmods.net/index.ph...ents#RoundTime

Anyway forget everything that you are thinking and do what i told you. Remove gamemaster and use orpheu/regame depending if you running hlds/rehlds
Unfortunately, the Orpheu modules seem more complicated for my mod than the Gamemaster module.
Dark Hacker is offline
Jhob94
AMX Mod X Moderator
Join Date: Jul 2012
Old 08-05-2024 , 07:57   Re: how to get and set the value of Round Timer
Reply With Quote #15

Use arkshine’s round terminator. You just need to upload the orpheu files
__________________
My Plugins List | My Tutorials List
Everything that i know was self-learned with the help of this community
If you want to thank me for my plugins
donate to alliedmodders
Jhob94 is offline
Old 08-05-2024, 08:00
v120kaaimcfg
This message has been deleted by v120kaaimcfg.
Jhob94
AMX Mod X Moderator
Join Date: Jul 2012
Old 08-05-2024 , 08:09   Re: how to get and set the value of Round Timer
Reply With Quote #16

Quote:
Originally Posted by v120kaaimcfg View Post
When does it not work? What conditions?
He doesn’t need that. He is asking help because of gamemaster. It was a module full of bugs that dias created to avoid the usage orpheu around 10 years ago before we had rehlds. He just need to use regame or orpheu to make infinite round and force the round end via plugin.
__________________
My Plugins List | My Tutorials List
Everything that i know was self-learned with the help of this community
If you want to thank me for my plugins
donate to alliedmodders
Jhob94 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:47.


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