Forum

> > CS2D > Scripts > 1 CT Only in Round
Forums overviewCS2D overview Scripts overviewLog in to reply

English 1 CT Only in Round

4 replies
To the start Previous 1 Next To the start

old 1 CT Only in Round

Jezhen
User Off Offline

Quote
Hi, i want help because i want to do a server, but i need to create or a script for this problem, i tell u.

1 CT in one round, after ends that round another new CT random, u know what i mean?

All can be TT, but only one CT, and after the round ends the next round another random CT.

If someone can answer correct this, ty.

old Re: 1 CT Only in Round

wotaan
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
34
35
36
37
38
addhook("startround","startroundwot")
function startroundwot()
	local ppl={}
	local coun=1
	for id=1,32 do
		if player(id,"exists") then
			ppl[coun]=id
			coun=coun+1
		end
	end
	local rndct=math.random(1,#ppl)
	for kid=1,#ppl do
		if rndct==kid then
			if player(ppl[kid],"team")~=2 then
				parse("makect "..ppl[kid])
			end
		else
			if player(ppl[kid],"team")~=1 then
				parse("maket "..ppl[kid])
			end
		end
	end
end


addhook("team","teamwot")
function teamwot(id,t)
	if t==2 then
		for kid=1,32 do
			if player(kid,"exists") then
				if player(kid,"team")==2 then
					msg2(id,"©255000000Only 1 person can be ct@C")
					return 1
				end
			end
		end
	end
end

old Re: 1 CT Only in Round

Jezhen
User Off Offline

Quote
user wotaan has written
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
34
35
36
37
38
addhook("startround","startroundwot")
function startroundwot()
	local ppl={}
	local coun=1
	for id=1,32 do
		if player(id,"exists") then
			ppl[coun]=id
			coun=coun+1
		end
	end
	local rndct=math.random(1,#ppl)
	for kid=1,#ppl do
		if rndct==kid then
			if player(ppl[kid],"team")~=2 then
				parse("makect "..ppl[kid])
			end
		else
			if player(ppl[kid],"team")~=1 then
				parse("maket "..ppl[kid])
			end
		end
	end
end


addhook("team","teamwot")
function teamwot(id,t)
	if t==2 then
		for kid=1,32 do
			if player(kid,"exists") then
				if player(kid,"team")==2 then
					msg2(id,"©255000000Only 1 person can be ct@C")
					return 1
				end
			end
		end
	end
end
Don't Works!!!
edited 1×, last 09.02.13 01:48:25 am

old Re: 1 CT Only in Round

sheeL
User Off Offline

Quote
Like this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
maxct = 1   -- Max

addhook('team','mt_team')
function mt_team(id,team,look)
     if team==2 and #player(0,"team2") >= maxct then
          msg2(id,"©255000000You cant Join now!")
          return 1
     end
end



addhook("startround_prespawn","start")
function start()
     for i=1,#player(0,"table") do
          parse("maket "..i)
          max_players = #player(0,"table")
          random_player = math.random(1,max_players)
               if player(random_player,'exists') then
                    parse("makect "..random_player)
               end
         end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview