Forum

> > CS2D > Scripts > performing multiple round restarts
Forums overviewCS2D overview Scripts overviewLog in to reply

English performing multiple round restarts

4 replies
To the start Previous 1 Next To the start

old performing multiple round restarts

Pawelek212
User Off Offline

Quote
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 comment

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

old Re: performing multiple round restarts

DC
Admin Off Offline

Quote
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.
edited 2×, last 25.02.11 07:42:03 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview