Forum

> > CS2D > Scripts > CT for multiple USGNs?
Forums overviewCS2D overview Scripts overviewLog in to reply

English CT for multiple USGNs?

4 replies
To the start Previous 1 Next To the start

old CT for multiple USGNs?

Mami Tomoe
User Off Offline

Quote
Hi, I need help. (yes again don't blame me I am doing my best understanding lua ._.)

I tried to make a lua that will only let some USGN users join the CT side (multiple USGNs)

But when I did it I failed and got many errors, anyways I didn't thought it was fixable so I just deleted it...

I used if (player(id, "usgn") == 99153) then that I was told about but that's only for 1 usgn...

Help plaz...

Spoiler >

old Re: CT for multiple USGNs?

Starkkz
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
CTS = {your id, another id, etc}

function CheckCT(id)
     for i = 1, #CTS do -- from the first id to the last id
          if player(id, "usgn") == CTS[i] then -- check if one of the ids belongs to the player
               return true
          end
     end
end
Later you just check if it's possible with:
if CheckCT(id) then

old Re: CT for multiple USGNs?

GeoB99
Moderator Off Offline

Quote
I'm not sure if it will work because I didn't test my code, but you can give a try if it does happen an action or something.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
USGN = {}

addhook("team","check")
function check(id,team)
	if team==2 then
		for i, v in ipairs(USGN) do
			if player(id,"usgn")== v then
				return 0 
			else
				parse("makespec "..id)
				return 1
			end
		end
	end
end
Make sure, you add your U.S.G.N. ID in USGN table list in order to have access to go to the CT team.
Edit1: I forgot to add return 1 near parse("makespec "..id) line, now is added.
edited 3×, last 10.08.15 11:47:12 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview