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! First of all it's "restart", not "sv_restart". And why the f*ck did you put 1 in the end? DC Admin Offline
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
DC has written
@Sunny Autumn: the number is the delay for the restart in seconds.
Oh, ye, right OHH thx DC
Ops fail all players can use !restart, how to make !restart command only for players with rcon ? edited 1×, last 25.02.11 09:12:15 pm