Forum

> > CS2D > Scripts > Only one person can join ct.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Only one person can join ct.

6 replies
To the start Previous 1 Next To the start

old Only one person can join ct.

Computerguy419
User Off Offline

Quote
I was given this script:

<code>
adminlist = {86418,86597}

addhook("team","checker")
function checker(id,team)
if team==2 then
for _, hasil in ipairs(adminlist) do
if player(id,"usgn")==hasil then
return 0
else
parse("maket "..id)
return 1
end
end
end
end
<code/>

It only lets on person join the ct at a time but I want everyone in the adminlist to join ct. Can I have some help?

√ Computerguy419

old Re: Only one person can join ct.

Apache uwu
User Off Offline

Quote
Like this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
adminlist = {86418,86597}

addhook("team","checker")
function checker(id,team)
	if team==2 then
		for _, hasil in ipairs(adminlist) do
			if player(id,"usgn")==hasil then
				return 0
			end
		end
		parse("maket "..id)
		return 1
	end
end

old Re: Only one person can join ct.

VADemon
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
adminlist = {86418,86597}

addhook("team","checker")
function checker(id,team)
	if team==2 then
		local move_back = true
		for _, hasil in ipairs(adminlist) do
			if player(id,"usgn")==hasil then
				move_back = false
				break
			end
		end
		if move_back then
			return 1
		end
	end
end
Should work.
@user Apache uwu:
Two returns? I don't like it
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview