Forum

> > CS2D > Mods > Spectator
Forums overviewCS2D overview Mods overviewLog in to reply

English Spectator

8 replies
To the start Previous 1 Next To the start

old Spectator

tos12345678
User Off Offline

Quote
How off spectator mode.
For all players can't join to Spectator mode ?
I found nice bug in zombie mode

old Re: Spectator

VADemon
User Off Offline

Quote
This "bug" is commonly referred to as team switching and you only need to forbid to join the spectator team via a Lua script.

old Re: Spectator

Cure Pikachu
User Off Offline

Quote
@user Talented Doge: It will still allow players to join the Spectators (War Mode only prevents them from seeing anything), so the bug can still be done.

And the script to "fix" the bug (this just prevents the Zombies from joining the Spectators):
1
2
3
4
5
6
7
8
9
10
if tonumber(game("sv_gamemode")) == 4 then
	addhook("team","zbteam",5)
end

function zbteam(id,team)
	if team == 0 and player(id,"team") == 1 then
		msg2(id,"©255000000You cannot join the Spectators at this time!")
		return 1
	end
end
This one will prevent Spectators who were Zombies from joining the Survivors (updated x2):
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
pastteam = {}
changedteam = {}

if tonumber(game("sv_gamemode")) == 4 then
	addhook("team","zbteam",5)
	addhook("leave","zbleave")
	addhook("startround","zbstart")
end

function zbteam(id,team)
	if team == 2 and pastteam[id] == 1 and changedteam[id] then
		msg2(id,"©255000000You cannot join the Spectators at this time!")
		return 1
	end
	if team > 0 then
		pastteam[id] = team
	end
	changedteam[id] = true
end

function zbleave(id)
	pastteam[id] = nil
	changedteam[id] = nil
end

function zbstart()
	for _, id in ipairs(player(0,"table")) do
		changedteam[id] = false
	end
end
Use either one of these.
edited 4×, last 23.12.15 03:46:27 pm

old Re: Spectator

tos12345678
User Off Offline

Quote
Good...

-Zombie Can't go survivors

I want - Survivators cant go zombie and (survivator)

Normal = I'm survivator choose spectator (DIE) and again go survivator

old Re: Spectator

Cure Pikachu
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("team","zbteam",5)

function zbteam(id,team)
	if team == 0 then
		msg2(id,"©255000000You cannot join the Spectators!")
		return 1
	end
end
This will completely block off the Spectator team.
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview