force spectator teleport to player start

Discuss all aspects related to modding Zandronum here.
Post Reply
doomero
Forum Regular
Posts: 134
Joined: Tue Jun 05, 2012 3:45 am

force spectator teleport to player start

#1

Post by doomero » Wed Jun 10, 2015 4:14 am

Well i want to know if is possible when a player go to spectator, after he enter for play the map, force him to the player start or map spot with a specific tid. I am making a spect room and i need all the spectators go to that room.

User avatar
Monsterovich
Forum Regular
Posts: 343
Joined: Sun Jun 17, 2012 5:46 pm

RE: force spectator teleport to player start

#2

Post by Monsterovich » Wed Jun 10, 2015 10:47 am

You cannot give spectator a TID that means you can't use SetActorPosition on them.

You can try this, because spectators are actors too.

Code: Select all

// when player joins the game as spectator
script 1 open clientside
{
int target = 666;
SetActorPosition (0, GetActorX(target), GetActorY(target), GetActorZ(target), false); 
}

// when player spectates
script 2 (int player) disconnect clientside
{
int target = 666;
if (PlayerIsSpectator(player) > 0)
   SetActorPosition (0, GetActorX(target), GetActorY(target), GetActorZ(target), false); 
}
If it doesn't work, enjoy zandro.
Last edited by Monsterovich on Wed Jun 10, 2015 10:59 am, edited 1 time in total.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: force spectator teleport to player start

#3

Post by Watermelon » Wed Jun 10, 2015 1:59 pm

Monsterovich wrote: If it doesn't work, enjoy zandro.
Wrong:
If it doesn't work, make a tracker ticket and discuss it with the devs and see what can be done.

doomero
Forum Regular
Posts: 134
Joined: Tue Jun 05, 2012 3:45 am

RE: force spectator teleport to player start

#4

Post by doomero » Wed Jun 10, 2015 6:12 pm

Thanks for the answer, but that script is not working....

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: force spectator teleport to player start

#5

Post by CloudFlash » Thu Jun 11, 2015 6:00 am

Do I have to remind you that spectators can freely use noclip, and as such they can a)enter the spectator's room from pretty much any given point on the map, b)quit the spectator's room with little to no effort?
Also do I have to remind that it's possible to disable spectators from being able to talk to players in game, which is a way easier method of preventing them from spoiling the secrets/breaking the flow of the game via insanely helpful tips?
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: force spectator teleport to player start

#6

Post by Catastrophe » Thu Jun 11, 2015 6:10 am

doomero wrote: Thanks for the answer, but that script is not working....
You must loop the open clientside script for it to work on clients who have connected AFTER a map has begun.

Post Reply