Forum

> > CS2D > Scripts > how to stop 2 usgn login
Forums overviewCS2D overview Scripts overviewLog in to reply

English how to stop 2 usgn login

52 replies
Page
To the start Previous 1 2 3 Next To the start

old Re: how to stop 2 usgn login

Avo
User Off Offline

Quote
Oh, I forgot about that, now I fixed it and tested with dedicated, 100% works:
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
usgns={}

function check_usgn(usgn)
     if usgn==0 then 
          return false
     end
     for _,id in pairs(usgns) do
          if id==usgn then 
               return true
          end
     end
     return false
end
addhook("join","_join")
function _join(id)
	if check_usgn(player(id,"usgn")) then
		timer(2500,"parse","kick "..id.." \"Two players with the same USGN number are not allowed to play!\"")
	else
		table.insert(usgns,player(id,"usgn"))
	end
end
addhook("leave","_leave")
function _leave(id)
     if player(id,"usgn")>0 then
          for n,ID in pairs(usgns) do
               if ID==player(id,"usgn") then 
                    table.remove(usgns,n)
               end
          end
     end
end

old Re: how to stop 2 usgn login

Yates
Reviewer Off Offline

Quote
You can just set the IP clients to 1 which will stop 90% of two U.S.G.N's joining. The other 10% is either;
     The person has two Internet connections, or just changed his IP.
     The person has gave someone else his U.S.G.N.

old Re: how to stop 2 usgn login

Avo
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
usgns={}

function check_usgn(usgn)
     if usgn==0 then 
          return false
     end
     for _,id in pairs(usgns) do
          if id==usgn then 
               return true
          end
     end
     return false
end
addhook("join","_join")
function _join(id)
     if check_usgn(player(id,"usgn")) then
        timer(2500,"parse","kick "..id.." \"Two players with the same USGN number are not allowed to play!\"")
     end
	 table.insert(usgns,player(id,"usgn"))
end
addhook("leave","_leave")
function _leave(id)
     if player(id,"usgn")>0 then
          for n,ID in pairs(usgns) do
               if ID==player(id,"usgn") then 
                    table.remove(usgns,n)
					break
               end
          end
     end
end

old Re: how to stop 2 usgn login

Infinite Rain
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
USGN_Table = {}

addhook('join', 'JoinHook')
function JoinHook(id)
	for n, w in pairs(USGN_Table) do
		if w == player(id, 'usgn') then
			parse('kick '.. id)
		end
	end
	if player(id, 'usgn') > 0 then table.insert(USGN_Table, player(id, 'usgn')) end
end

addhook('leave', 'LeaveHook')
function LeaveHook(id)
	for n, w in pairs(USGN_Table) do
		if w == player(id, 'usgn') then
			table.remove(USGN_Table, n)
		end
	end
end
Haven't tested yet, but should work.

Edit: Damn Bolt is faster... Well, my is more complicated then.

Edit2: AMG Bolt have lots of useless lines in his version.
edited 1×, last 06.07.12 06:48:57 pm

old Re: how to stop 2 usgn login

Infinite Rain
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
USGN_Table = {}

addhook('join', 'JoinHook')
function JoinHook(id)
     for n, w in pairs(USGN_Table) do
          if w == player(id, 'usgn') then
               timer(500, 'parse', 'kick '.. id)
          end
     end
     if player(id, 'usgn') > 0 then table.insert(USGN_Table, player(id, 'usgn')) end
end

addhook('leave', 'LeaveHook')
function LeaveHook(id)
     for n, w in pairs(USGN_Table) do
          if w == player(id, 'usgn') then
               table.remove(USGN_Table, n)
          end
     end
end

Ok, now this is perfect.

old Re: how to stop 2 usgn login

EP
User Off Offline

Quote
Well, had to do this.
1
2
3
4
5
6
7
8
9
10
addhook("join","usgns")
function usgns(id)
	for _,i in ipairs(player(0,"table")) do
		if id ~= i and player(i,"usgn") > 0 then
			if player(i,"usgn") == player(id,"usgn") then
				timer(100,"parse","kick "..id)
			end
		end
	end
end
To the start Previous 1 2 3 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview