Forum

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

Englisch Only Admins can join ct

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Only Admins can join ct

Computerguy419
User Off Offline

Zitieren
I would like to make a script so that only players in that I have in my variable: adminlist, can join the ct. I need to be able to use the usgn #.

Thanks,
√ Computerguy419

alt LOL

MikuAuahDark
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
adminlist = {86418}	-- Adminlist separated by comma

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
1× editiert, zuletzt 09.03.12 10:47:14

alt Re: Only Admins can join ct

blazeranger
User Off Offline

Zitieren
can i get that script but there would be a variable which chooses which team only admins can join? i would do it myself but i cant

edit; oh i saw the 2 and i think thats the team? am i right i just change it to 1?

alt Re: Only Admins can join ct

EngiN33R
Moderator Off Offline

Zitieren
Well, the team==2 is obviously the team number (2 is CT, 1 is T). If you want a variable, then it would look something like
1
2
3
adminteam = 1
-- code... --
if team==adminteam then

alt Re: Only Admins can join ct

blazeranger
User Off Offline

Zitieren
thanks, but i was asking for the actual code, i cant code
so all i have to do is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
adminlist = {86418}     -- Adminlist separated by comma

addhook("team","checker")
function checker(id,team)
     if team==1 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

with all the spaces etc. am i correct?
and i just change the 2 to a 1 and put my USGN in?

alt Re: Only Admins can join ct

EngiN33R
Moderator Off Offline

Zitieren
That will make it so that only admins can join T, yes, but you also need to change
1
parse("maket "..id)
to
1
parse("makect "..id)
if you want it like that.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht