Forum

> > CS2D > Scripts > performing multiple round restarts
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch performing multiple round restarts

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt performing multiple round restarts

Pawelek212
User Off Offline

Zitieren
my script:

1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","livemode")
function livemode(second,txt)
	if (txt=="!restart") then 
	msg("[----Fight after 3 restarts----]")
	parse("sv_restart 1" )
	msg("[-----#1-----]" )
	parse("sv_restart 1" )
	msg("[-----#2-----]" )
	parse("sv_restart 1" )
	msg("[-----#3-----]" )
	parse("sv_restart 1" )
	msg("[---LIVE-----]" ) end
end

when i type in game !restart game has got only 1 restart and i see this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[----Fight after 3 restarts----]
Round Restart in 1 sec
[-----#1-----]
ERROR: Unknown command '1' (sv_restart 1)
Use quotation marks for parameters with blanks. e.g.: mp_unbuyable "Tactical Shield"
Visit CS2D.com/help for a command reference
[-----#2-----]
ERROR: Unknown command '1' (sv_restart 1)
Use quotation marks for parameters with blanks. e.g.: mp_unbuyable "Tactical Shield"
Visit CS2D.com/help for a command reference
[-----#3-----]
ERROR: Unknown command '1' (sv_restart 1)
Use quotation marks for parameters with blanks. e.g.: mp_unbuyable "Tactical Shield"
Visit CS2D.com/help for a command reference
[---LIVE-----]

can someone help me ?

Admin/Mod Kommentar

"Need lua help !" = bad, generic and pointless title, fixed!

alt Re: performing multiple round restarts

DC
Admin Off Offline

Zitieren
the CS2D round restart system is different than the CS round restart system. you can't spam mass round restarts. no matter how often you do it: cs2d will restart only once.

doing multiple restarts automatically would require Lua timers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
livemode_counter=0

addhook("say","livemode")
function livemode(second,txt)
	if (txt=="!restart") then
		timer(1000,"livemode_restart","",3)
		msg("[----Fight after 3 restarts----]")
		livemode_counter=0
		return 1
	end
end

function livemode_restart()
	parse("sv_restart")
	livemode_counter=livemode_counter+1
	if livemode_counter<3 then
		msg("[-----#"..livemode_counter.."-----]" )
	else
		msg("[---LIVE-----]" )
	end
end
btw: your script had 4 restarts, not 3

@Sunny Autumn: the number is the delay for the restart in seconds.
2× editiert, zuletzt 25.02.11 19:42:03
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht