Forum

> > CS2D > Scripts > Countdown Script Sample Need
Forums overviewCS2D overview Scripts overviewLog in to reply

English Countdown Script Sample Need

5 replies
To the start Previous 1 Next To the start

old Re: Countdown Script Sample Need

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
rtcdown=0

function randplayer()
	parse("maket "..player(0,"team2")[math.random(1,#player(0,"team2"))])
end

function countdown()
	rtcdown=10
	msg(rtcdown)
	timer(1000,"parse","lua rtcdown=rtcdown-1",10)
	timer(1000,"parse","lua msg(rtcdown)",10)
	timer(10000,"randplayer")
end

addhook("startround","checkfort")
function checkfort()
	if #player(0,"team1")==0 then
		countdown()
	end
end

I guess this solution would work.

old Re: Countdown Script Sample Need

BcY
Reviewer Off Offline

Quote
thanks engineer..

but add 10,9,8,7,....,6,5,...2,1,0 cound and "nickname" is first zombie! please.

and why are there terrorist at the startround.it shouldnt any Ts.
i want there are only ct at the startround and after the countdown a random ct player send to Ts.and msg ... is the first zombie!

old Re: Countdown Script Sample Need

EngiN33R
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
25
26
27
28
rtcdown=0

function randplayer()
     local rndpl=player(0,"team2")[math.random(1,#player(0,"team2"))]
     parse("maket "..rndpl)
     return rndpl
end

function countdown()
     rtcdown=10
     msg(rtcdown)
     timer(1000,"parse","lua rtcdown=rtcdown-1; lua msg(rtcdown)",10)
     timer(10000,"parse","lua \"msg(player(randplayer(),'name')..' is the first zombie!')\"")
end

addhook("startround","checkfort")
function checkfort()
     if #player(0,"team1")==0 then
          countdown()
     end
end

addhook("endround","makeallct")
function makeallct()
     for _,i in pairs(player(0,"table")) do
          parse("makect "..i)
     end
end

I honestly couldn't be bothered to make it prettier and better, but this would work and it's pretty nice still.
edited 1×, last 03.04.12 10:09:49 am

old Re: Countdown Script Sample Need

4Vendetta
User Off Offline

Quote
I think this should works to.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function _startround()
     for _,id in ipairs(player(0,"team1")) do
          parse("makect "..id)
     end
     count_down=15
end

function _second()
     if count_down~=nil then
          if count_down==-1 then
               t=player(0,"team2")[math.random(0,#player(0,"team2"))]
               msg(string.char(169).."255255255"..player(t,"name").." is the Nemesis@C")
               parse("maket "..t)
               count_down=nil
          else
               msg(string.char(169).."255255255"..count_down.."@C")
               count_down=count_down-1
          end
     end
end

_startround()
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview