Forum

> > CS2D > Scripts > Counter Lua (Need Help)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Counter Lua (Need Help)

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Counter Lua (Need Help)

TimeQuesT
User Off Offline

Zitieren
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...

alt Re: Counter Lua (Need Help)

TimeQuesT
User Off Offline

Zitieren
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)

alt rehelp

CS2D_TURKEY
User Off Offline

Zitieren
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

alt Re: Counter Lua (Need Help)

Yasday
User Off Offline

Zitieren
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.

alt thanks

CS2D_TURKEY
User Off Offline

Zitieren
thanks script run

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


thanks..
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht