Forum

> > CS2D > Scripts > Counter Lua (Need Help)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Counter Lua (Need Help)

8 replies
To the start Previous 1 Next To the start

old Re: Counter Lua (Need Help)

TimeQuesT
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
count = 20

addhook ("second","sec")
function sec()
if (count>0) then
count = count - 1
msg (count)
else
--event
end
end

you only have to let the variable "count" refresh on roundstart...

old Re: Counter Lua (Need Help)

TimeQuesT
User Off Offline

Quote
i think he meant a timed counter... like 1... wait-one-second 2... wait-one-second 3...

yours would count down under one second (nearly some ms)

old rehelp

CS2D_TURKEY
User Off Offline

Quote
well
To do so?
Example

IMG:https://img703.imageshack.us/img703/7086/69003705.jpg


Like in this picture
Backward counting at zero end

zero end

If anyone know thank you

old Re: Counter Lua (Need Help)

Yasday
User 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
25
26
27
28
29
30
31
32
33
function hudtxt2(id,i,txt,x,y,algin)
	if not algin then algin = 0 end
	parse([[hudtxt2 ]]..id..[[ ]]..i..[[ "]]..txt..[[" ]]..x..[[ ]]..y..[[ ]]..algin)
end

function timehud()
	for _,pl in ipairs(player(0,"table")) do
		if sec >= 10 and h >= 10 then
			hudtxt2(pl,1,"©072118255"..h..":"..sec,290,440,0)
		elseif sec >= 10 and h < 10 then
			hudtxt2(pl,1,"©0721182550"..h..":"..sec,290,440,0)
		elseif sec < 10 and h >= 10 then
			hudtxt2(pl,1,"©072118255"..h..":0"..sec,290,440,0)
		elseif sec < 10 and h < 10 then
			hudtxt2(pl,1,"©072118255: 0"..h..":0"..sec,290,440,0)
		end
	end
end

sec = 59
h = 24
addhook([[second]],[[seconder]])
function seconder()
	if sec <= 0 then
		sec = 59
		h = h - 1
	end
	if h <= 0 then
		--event
	end
	sec = sec - 1
	timehud()
end
Try it. hudtxt2 isn't necessary, but I don't want to correct that now.

old thanks

CS2D_TURKEY
User Off Offline

Quote
thanks script run

in the same way
display the next map
Can you do ?


thanks..
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview