Forum

> > CS2D > Scripts > Script Restart Round Every 30 Minutes.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script Restart Round Every 30 Minutes.

18 replies
To the start Previous 1 Next To the start

old Re: Script Restart Round Every 30 Minutes.

Rainoth
Moderator Off Offline

Quote
Please use search tool. I remember someone asking exactly the same thing some time ago (maybe even the image is same o.O)

1
2
3
4
5
addhook("startround","whatever")
function whatever()
	freetimer("parse","restart")
	timer(1800000,"parse","restart")
end

old Re: Script Restart Round Every 30 Minutes.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
min = 30
sec = 0
posX = 240 -- change to wherever you want in screen
posY = 240 -- same thing for Y axis value

addhook("second","whatever")
function whatever()
	if sec == 0 then
		sec = 59
		if min > 0 then
			min = min - 1
		elseif min == 0 then
			parse("restart")
			min = 30
		end
	end	
	parse('hudtxt 0 "\169255255255Time until restart: "..min..":"..sec..'" "..posX.." "..posY.." 0')
end

addhook("startround","alsowhatever")
function alsowhatever()
	min = 30
	sec = 0
end

Note that I was too lazy to make it perfect. When seconds are below 10, you will see a single number.
In other words
14:11
14:10
14:9
not
14:11
14:10
14:09
Anyone is free to fix it up.

old Re: Script Restart Round Every 30 Minutes.

TimeQuesT
User Off Offline

Quote
@user Rainoth: Just 4 lines to add

Changed Version >

old Re: Script Restart Round Every 30 Minutes.

GamerX 17323
User Off Offline

Quote
user TimeQuesT has written
@user Rainoth: Just 4 lines to add

Changed Version >


LUA ERROR: sys/lua/construa.lua:17: ')' expected near '" "'

old Re: Script Restart Round Every 30 Minutes.

TimeQuesT
User Off Offline

Quote
@user Staming: Please read the thread topic again.

Fixed version (works for me) >

old Re: Script Restart Round Every 30 Minutes.

TimeQuesT
User Off Offline

Quote
RM forgot to decrement the variable "sec" by each call.

*Fix2 >

old Re: Script Restart Round Every 30 Minutes.

TimeQuesT
User Off Offline

Quote
Open console and write this:
1
lua min = YourNumberHere;

And for seconds

1
lua sec = YourNumberHere;

Depending if you're using a dedicated you also have to add rcon infront of the command. Like:
1
rcon lua min = YourNumberHere;
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview