Forum

> > CS2D > Scripts > Lua Question - Team Switch
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Question - Team Switch

6 replies
To the start Previous 1 Next To the start

moved Lua Question - Team Switch

Anders4000
User Off Offline

Quote
Hello (:

I can't find any parse that makes a player switch team...
I would like to make a play spec, and when he try to change team to CT it will go back to Spec.
Anyway thats possible?

Thanks (:
- Anders4000

Admin/mod comment

Wrong forum.

old Re: Lua Question - Team Switch

_Ultimate_
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
58
59
60
61
elseif string.sub(message, 1, 7)=="@lockt " then
        tmpid=string.sub(message, 8)
	if player(tmpid, "exists") then
	locked[tmpid-1+1]=1
	parse("maket "..tmpid)
	msg(Color(255, 255, 255), player(id, "name").." LOCKED "..player(tmpid, "name").." TO THE T SIDE.")
	return 1
	else
	msg2(id, Color(255, 0, 0), "Player does not exist!")
	return 1
	end
else
msg2(id, Color(255, 0, 0), "Access Denied!")
return 1
end

elseif string.sub(message, 1, 8)=="@lockct " then
        tmpid=string.sub(message, 9)
	if player(tmpid, "exists") then
	locked[tmpid-1+1]=2
	parse("makect "..tmpid)
	msg(Color(255, 255, 255), player(id, "name").." LOCKED "..player(tmpid, "name").." TO THE CT SIDE.")
	return 1
	else
	msg2(id, Color(255, 0, 0), "Player does not exist!")
	return 1
	end
else
msg2(id, Color(255, 0, 0), "Access Denied!")
return 1
end
elseif message=="@switch" then
                        for i=1,32 do
			if player(i, "exists") then
				if player(i, "team")==1 then
					locked[i]=2
					parse("makect "..i)
				elseif player(i, "team")==2 then
					locked[i]=1
					parse("maket "..i)
				end
			end
		end
	msg(Color(255, 255, 255), player(id, "name").." SWITCHED sides.")
	return 1
	else
	msg2(id, Color(255, 0, 0), "Access Denied!")
	end
elseif string.sub(message, 1, 10)=="@lockspec " then
        tmpid=string.sub(message, 11)
	if player(tmpid, "exists") then
	locked[tmpid-1+1]=3
	parse("makespec "..tmpid)
	msg(Color(255, 255, 255), player(id, "name").." LOCKED "..player(tmpid, "name").." TO THE SPEC SIDE.")
	return 1
	else
	msg2(id, Color(255, 0, 0), "Player does not exist!")
	return 1
	end
end
end
I DID NOT make these scripts koss did i taked them from his lua they work you just need to change some things dude hope i helped
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview