Forum
CS2D Scripts round restart scriptround restart script
10 replies 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local Rounds = 0 function RoundCountRestart(mode) if ( mode == 1 or mode == 20 or mode == 30 ) then Rounds = Rounds + 1 if ( Rounds == 15 ) then parse('restart 0') msg('The Terrorist team has won the match! Restarting...') end elseif ( mode == 2 or mode == 21 or mode == 22 or mode == 31 ) then Rounds = Rounds + 1 if ( Rounds == 15 ) then parse('restart 0') msg('The Counter-Terrorist team has won the match! Restarting...') end end end addhook('endround', 'RoundCountRestart')
I chose second for performance reasons. Wouldn't make much sense to use always or ms100.
edited 1×, last 15.01.17 06:56:18 pm
GeoB99 has written
You could do it at RoundCountRestart(m)function.
CurrentRoundskeeps getting increased.
So I fixed that and I somehow shortened the code a bit, so it looks like this:
I also added the line 21 to set the
currentto 0 in case if an administrator or a highly prioritized player force restarts the round.
edited 1×, last 15.01.17 11:22:19 pm
Notice that you have to put your image's name on line 4, otherwise it will give an error.
1