Forum

> > CS2D > Scripts > how to stop 2 usgn login
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch how to stop 2 usgn login

52 Antworten
Seite
Zum Anfang Vorherige 1 2 3 Nächste Zum Anfang

alt Re: how to stop 2 usgn login

Avo
User Off Offline

Zitieren
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

alt Re: how to stop 2 usgn login

Yates
Reviewer Off Offline

Zitieren
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.

alt Re: how to stop 2 usgn login

Avo
User Off Offline

Zitieren
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

alt Re: how to stop 2 usgn login

Infinite Rain
Reviewer Off Offline

Zitieren
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.
1× editiert, zuletzt 06.07.12 18:48:57

alt Re: how to stop 2 usgn login

Infinite Rain
Reviewer Off Offline

Zitieren
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.

alt Re: how to stop 2 usgn login

EP
User Off Offline

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