Forum

> > CS2D > Scripts > CLAN VS ALL
Forums overviewCS2D overview Scripts overviewLog in to reply

English CLAN VS ALL

6 replies
To the start Previous 1 Next To the start

old CLAN VS ALL

_Ultimate_
User Off Offline

Quote
hey guys i was thinking if someone can help me to make a clan vs all script i am using koss's lua on my servers and i was looking at them today and i found this

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
if exists("sys/lua/Members/"..myusgn[id]..".txt") then
	for line in io.lines("sys/lua/Members/"..myusgn[id]..".txt") do 
		currentrank[iii-1+1]=line
		print (line)
		iii=iii+1
	end
		if currentrank[1]=="0" then
			--else state only
		else
			myname[id]=currentrank[2]
			msg2(id, Color(0, 0, 0), "Welcome Back "..currentrank[2].."!")
		end
			if currentrank[1]=="-1" then --aca
				rankid[id]=-1
			elseif currentrank[1]=="2" then --member
				rankid[id]=2
			elseif currentrank[1]=="3" then --mod
				rankid[id]=3
			elseif currentrank[1]=="4" then --admin
				rankid[id]=4
				thecolor[id]={255, 0, 0}
				mytag[id]="ADMIN"
			elseif currentrank[1]=="5" then --superadmin
				rankid[id]=5
				thecolor[id]={255, 255, 255}
				mytag[id]="S-ADMIN"
			elseif currentrank[1]=="1" then --vip
					if checkyes==1 then
						thekick=id
						thereason="You must be in DwS || to join this server!"
						timer(20, "timekick")
					end
					rankid[id]=1
			else
					if checkyes==1 then
						thekick=id
						thereason="You must be in DwS || to join this server!"
						timer(20, "timekick")
					end
					rankid[id]=0
			end
else
	if checkyes==1 then
	thekick=id
	thereason="You must be in DwS || to join this server!"
	timer(20, "timekick")
	end
end

end

i really suck at lua codding but i was thinking if i can put something like that

1
2
then make T
elseif make CT
after that exist member thing... idk i hope someone can help me here

old Re: CLAN VS ALL

DannyDeth
User Off Offline

Quote
Easier way to do this is like so:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mems = { 123, 456 } --insert your clans usgn ids here

addhook("team","mems_on_T")
function mems_on_T(id,team)
	local A = mems[player(id,"usgn")]
	if A and team==1 then
		return 0
	elseif team==1 and A==nil then
		msg2(id,"©255000000Only clan members can join Terrorists!")
		parse("makect "..id)
		return 1
	elseif team==2 and A then
		msg2(id,"©255000000Clan members = T, others = CT!")
		parse("maket "..id)
		return 1
	end
end

EDITS: Fixed the code up, made it work for sure now
edited 3×, last 28.01.11 01:30:17 pm

old Re: CLAN VS ALL

Yasday
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
mems = { 123, 456 } --insert your clans usgn ids here

function find(t)
	for i,v in ipairs(mems) do
		if tonumber(v) == player(t,"usgn") then
			return true
		end
	end
	return false
end

addhook("team","mems_on_T")
function mems_on_T(id,team)
	local A = find(id)
	if A == true and team==1 then
		return 0
	elseif team==1 and A==false then
		msg2(id,"©255000000Only clan members can join Terrorists!")
		parse("makect "..id)
		return 1
	elseif team==2 and A == true then
		msg2(id,"©255000000Clan members = T, others = CT!")
		parse("maket "..id)
		return 1
	end
end
Code fixed.
edited 1×, last 02.02.11 04:00:01 pm

old Re: CLAN VS ALL

_Ultimate_
User Off Offline

Quote
thank you let me try

edit: does not work

i truyed again almost work i mean it makes the members on t side but the other guys can steal join T
edited 1×, last 30.01.11 04:29:17 am

old Re: CLAN VS ALL

cortz
Super User Off Offline

Quote
What you have is not the "Clan vs ALL" script

Its the training script where it kicks people if they arent in the clan


But remember koss's script is faulty and is not entirely usuable.

old Re: CLAN VS ALL

DannyDeth
User Off Offline

Quote
The script works 100% fine for me, lol. Put it in your server.lua file without using Koss's server script and you will see it works 100% fine!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview