Forum

> > CS2D > Scripts > Only one person can join ct.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Only one person can join ct.

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Only one person can join ct.

Computerguy419
User Off Offline

Zitieren
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

alt Re: Only one person can join ct.

Apache uwu
User Off Offline

Zitieren
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

alt Re: Only one person can join ct.

VADemon
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht