Avo hat geschrieben
Me not o_O.
I rund CS2D, start lan server, join.
I run the second window of CS2D, join previous server, and then it kicks the second player.
My script does the same, but I just forgot to write in the kick part.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
_Parr={}
function in_table(t,k)
	for key, v in pairs(k) do
		if _Parr[v] then
			if v == t then return true end
		end
		_Parr[v] = key
	end
	return false
end
function show_table(t)
	for k, v in pairs(t) do
		print(k,v)
	end
end
addhook("join","on_join")
function on_join(p)
	local _P={[1]=player(p,"exists"),[2]=player(p,"name")}
	local rsn={[1]=" has the same U.S.G.N. as another player in the server.",[2]="Duplicated U.S.G.N. ID detected!"}
	local U_ID=player(p,"usgn")
	if (_P[1]) then
		-- Player exist.
		parse("sv_msg ©102255102Player ".._P[2].." exist.")
		if (U_ID~=nil or U_ID~=0 and U_ID==in_table(_Parr,U_ID)) then
			-- Player has a U.S.G.N. ID of 1 or higher.
			-- The script will insert the player U.S.G.N. ID into players table.
			parse("sv_msg ©090090090".._P[2].." (ID: #"..p..", U.S.G.N. ID: #"..U_ID..") joined the game!")
			parse("sv_msg ©255102102".._P[2]..rsn[1].."")
			parse("kick "..p.." "..rsn[1])
		elseif (U_ID==(not in_table(_Parr,U_ID))) then
			-- Player U.S.G.N. is not in table.
			table.insert(_Parr,U_ID)
			parse("sv_msg ©135135135".._P[2].." (ID: #"..p..", U.S.G.N. ID: #"..U_ID..") joined the game and is now registered with the server for the first time!")
		elseif (U_ID==0 or U_ID==nil) then
			-- Guest player with U.S.G.N. ID of (#0).
			parse("sv_msg ©096096096You're playing as a guest.")
		end
	elseif (_P==false) then
		-- Player doesn't exist.
		parse("sv_msg ©255102102Player ".._P[2].." doesn't exist.")
	end
end
addhook("spawn","on_spawn")
function on_spawn(p)
	local _P={[1]=player(p,"exists"),[2]=player(p,"name")}
	if (_P[1]) then
		parse('hudtxt2 '..p..' 1 "©102255102You joined as '.._P[2]..'!" 290 22 0')
	end
end
See if this works or not, I'm trying to perfect it. I'm basically checking if there is a U.S.G.N. ID in the table, if there isn't then the player who are joining the game will be allowed to stay on the server. However if there already is a U.S.G.N. ID in the table the player will get kicked with a reason as supplied in the Lua script. If there is player's without U.S.G.N. ID's then it'll just skip the check and allow them to play. Hope it works out for you, I think it worked out fine for me.