Forum

> > CS2D > Scripts > USGN+Steam only
Forums overviewCS2D overview Scripts overviewLog in to reply

English USGN+Steam only

10 replies
To the start Previous 1 Next To the start

old USGN+Steam only

mrc
User Off Offline

Quote
I've tryied this but doesn't work. I still can join Terrorists and Counter Terrorists with no USGN and Steam. *fixedty

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
--------------------------------------------------
-- Registered Only Script by Unreal Software    --
-- 23.02.2009 - www.UnrealSoftware.de           --
-- Only USGN users are allowed to join a team   --
--------------------------------------------------

if sample==nil then sample={} end
sample.regonly={}

-----------------------
-- Team Hook         --
-----------------------
addhook("team","sample.regonly.team")
function sample.regonly.team(id,team)
	if (team>0) then
		-- USGN only!
		if player(id, 'usgn') > 0 or player(id, 'steamid') ~= '0' then
			-- Allow USGN users
			return 0
		else
			-- Don't allow unregistered
			msg2(id,"©255000000Only USGN and Steam users are allowed to join a team on this server!@C")
			msg2(id,"©255000000Please login or register!@C")
			return 1
		end
	else
		-- Everyone is allowed to be spectator!
		return 0
	end
end

-- NOTE THE FOLLOWING:
-- team 0 = spectators
-- team 1 = terrorists
-- team 2 = counter-terrorists (team 3 = counter-terrorists, VIP for as_ maps)
edited 1×, last 15.03.18 10:52:23 pm

old Re: USGN+Steam only

Gaios
Reviewer Off Offline

Quote
1
if player(id, 'usgn') > 0 or player(id, 'steamid') ~= '0' then

old Re: USGN+Steam only

mrc
User Off Offline

Quote
works, but it has conflict with other script
edited 1×, last 15.03.18 10:37:16 pm

old Re: USGN+Steam only

Gaios
Reviewer Off Offline

Quote
@user mrc: So you use another scripts with team hook too.
Maybe try
addhook("team","sample.regonly.team", -12)
.

old Re: USGN+Steam only

mrc
User Off Offline

Quote
Yes Im using other script with team hook, Ill try, ty!

@edit with this script regonly doesnt work, what I have to do to fix?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
hitsounds = {}
hashes = {}
hashes["1ff855e59dc1d55fbdd899b3734bf65747078f41738b7ebdb1e6fdda54298e6b"] = "sfx/player/hit1.wav"
hashes["bb2b7393b580220df80966a5d4ed89c1f4eaa7e0d4690f27221e9dc021c4d9f2"] = "sfx/player/hit2.wav"
hashes["ebabd453fd91ef46f4067720bedf2ff51140e1d0f9f5cafd29c530c29bfddd4a"] = "sfx/player/hit3.wav"

addhook("team","hitsounds.team")
function hitsounds.team(id,team)
     if player(id,"team") == 0 then
          for _,path in pairs(hashes) do
               reqcld(id,4,path)
          end
     end
end

addhook("clientdata","hitsounds.clientdata")
function hitsounds.clientdata(id,mode,data1,data2)
     if mode == 4 and not hashes[data2] then
          parse("kick "..id.." \"Please replace your hitsounds to the default.\"")
     end
end
edited 2×, last 15.03.18 10:47:06 pm

old Re: USGN+Steam only

Merlungo
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--------------------------------------------------
-- Registered Only Script by Unreal Software    --
-- 23.02.2009 - www.UnrealSoftware.de           --
-- Only USGN users are allowed to join a team   --
--------------------------------------------------

if sample==nil then sample={} end
sample.regonly={}

-----------------------
-- Team Hook         --
-----------------------
addhook("team","sample.regonly.team")
function sample.regonly.team(id,team)
     if (team>0) then
          -- USGN only!
          if player(id, 'usgn') > 0 or player(id, 'steamid') ~= '0' then
               -- Allow USGN users
               return 0
          else
               -- Don't allow unregistered
               msg2(id,"©255000000Only USGN and Steam users are allowed to join a team on this server!@C")
               msg2(id,"©255000000Please login or register!@C")
               return 1
          end
     else
          -- Everyone is allowed to be spectator!
          return 0
     end
end

-- NOTE THE FOLLOWING:
-- team 0 = spectators
-- team 1 = terrorists
-- team 2 = counter-terrorists (team 3 = counter-terrorists, VIP for as_ maps)

hitsounds = {}
hashes = {}
hashes["1ff855e59dc1d55fbdd899b3734bf65747078f41738b7ebdb1e6fdda54298e6b"] = "sfx/player/hit1.wav"
hashes["bb2b7393b580220df80966a5d4ed89c1f4eaa7e0d4690f27221e9dc021c4d9f2"] = "sfx/player/hit2.wav"
hashes["ebabd453fd91ef46f4067720bedf2ff51140e1d0f9f5cafd29c530c29bfddd4a"] = "sfx/player/hit3.wav"

addhook("team","hitsounds.team",-12)
function hitsounds.team(id,team)
     if player(id,"team") == 0 then
          for _,path in pairs(hashes) do
               reqcld(id,4,path)
          end
     end
end

addhook("clientdata","hitsounds.clientdata")
function hitsounds.clientdata(id,mode,data1,data2)
     if mode == 4 and not hashes[data2] then
          parse("kick "..id.." \"Please replace your hitsounds to the default.\"")
     end
end

old Re: USGN+Steam only

mrc
User Off Offline

Quote
Can you explain why "-12"? I would like to know why. And what I have to do for more scripts with this problem? Just add -12 for all of them?

and to include this?

1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("team","lock2")
function lock2(id,team,look)
if lockct== 1 and team== 2 then
parse("makespec "..id.."")
msg2(id,"©255000000Counter-Terrorists are locked@C")
return 1
end
if lockt== 1 and team== 1 then
parse("makespec "..id.."")
msg2(id,"©255000000Terrorists are locked@C")
return 1
end
end
edited 2×, last 15.03.18 11:53:35 pm

old Re: USGN+Steam only

Merlungo
User Off Offline

Quote
I guess the -12 is so it does not interfere with any other addhook.

but to add that lock lua, you do not need to do anything
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview