Forum

> > CS2D > Scripts > round restart script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch round restart script

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: round restart script

GeoB99
Moderator Off Offline

Zitieren
1
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')
Didn't test it but should work flawlessly. By the way, care to elaborate what's the HUD in the screen supposed to be? A round counter? Time countdown? If not, then what?

alt Re: round restart script

GeoB99
Moderator Off Offline

Zitieren
The Code >

I chose cs2d lua hook second for performance reasons. Wouldn't make much sense to use cs2d lua hook always or cs2d lua hook ms100.

alt Re: round restart script

THEMUD
User Off Offline

Zitieren
The mere problem with @user GeoB99's code is that it initiates an immediate restart when the round ends, which leads to refuse the restart and continue and hence the
CurrentRounds
keeps getting increased.

So I fixed that and I somehow shortened the code a bit, so it looks like this:
Mehr >


I also added the line 21 to set the
current
to 0 in case if an administrator or a highly prioritized player force restarts the round.
1× editiert, zuletzt 15.01.17 23:22:19

alt Re: round restart script

THEMUD
User Off Offline

Zitieren
Image, click me! Do you mean like this?
Mehr >

Notice that you have to put your image's name on line 4, otherwise it will give an error.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht