Page 1 of 1

Automatic round ender

Posted: Mon Jul 19, 2021 8:27 am
by cssbestrpg
Hello, guys this a plugin that ends round when round time limit is ended
Only tested in css
https://github.com/srpg/round-end/tree/main

Re: Automatic round ender

Posted: Sat Aug 28, 2021 3:29 pm
by rautamiekka
Could these lines

Syntax: Select all

ftime = cvar.find_var('mp_freezetime').get_int()
rtime = cvar.find_var('mp_roundtime').get_int()
rtime = float(rtime * 60.0)
rtime = float(rtime + ftime)
rtime += 5
be replaced by these instead ?

Syntax: Select all

ftime = cvar.find_var('mp_freezetime').get_float()
rtime = cvar.find_var('mp_roundtime').get_float() * 60.0 + ftime + 5.0

Sorry about the indentation, phpBB destroyed it, so I removed it altogether.

Re: Automatic round ender

Posted: Sat Aug 28, 2021 3:32 pm
by cssbestrpg
rautamiekka wrote:Could these lines

Syntax: Select all

ftime = cvar.find_var('mp_freezetime').get_int()
rtime = cvar.find_var('mp_roundtime').get_int()
rtime = float(rtime * 60.0)
rtime = float(rtime + ftime)
rtime += 5
be replaced by these instead ?

Syntax: Select all

ftime = cvar.find_var('mp_freezetime').get_float()
rtime = cvar.find_var('mp_roundtime').get_float() * 60.0 + ftime + 5.0

Sorry about the indentation, phpBB destroyed it, so I removed it altogether.


Edit:

Just did test it works that way too

Re: Automatic round ender

Posted: Sat Aug 28, 2021 3:47 pm
by rautamiekka
Technically the

Code: Select all

.0
parts aren't necessary anymore, but I added them for clarity.

Re: Automatic round ender

Posted: Sat Aug 28, 2021 3:51 pm
by cssbestrpg
Correct me if i am wrong, so those .0 aren't need because the first value is from float right?

Re: Automatic round ender

Posted: Sat Aug 28, 2021 4:02 pm
by rautamiekka
Doesn't seem to matter whether it's float+int or int+float. Direct copypaste from ConEmu:

Syntax: Select all

Microsoft Windows [Version 10.0.19043.1165]

user@RAUTALAPTOP2 C:\
$ python
Python 3.9.6 (default, Jul 30 2021, 11:42:22) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

>>> 10.0+5
15.0
>>> 5+10.0
15.0

Re: Automatic round ender

Posted: Fri Apr 08, 2022 3:29 pm
by cssbestrpg
Update:
- Added checker for bombsite & hostage rescue zone
- If doesn't find bombsite & hostage rescue zone, automatic round ender triggers(when round time ends)