Stop Player Spawning on Connect

How do I stop a player from spawning automatically when they connect?

I’ve tried messing with GM:PlayerConnect, GM:PlayerInitialSpawn, and others.
Even killing them doesnt work…

You mean you want to place them in spectator or something?

Yeah, and Ive tryed pl:Spectate(OBS_MODE_WHATEVER) in PlayerConnect and PlayerInitialSpawn

Can you run anything in PlayerInitialSpawn?

I would like to know too, tried a few flavor of it, it’s like the Spectate function is completely ignored or something.

GM:PlayerInitialSpawn -> ply:SetTeam(TEAM_SPECTATOR)
It will automatically call GM:PlayerSpawnedAsSpectator, that will do the job

neat, what is the “other” default team?

i think it’s TEAM_UNASSIGNED and TEAM_JOINING

Joining/Connecting

i just tried, but i must be doing something wrong, it isn’t working at all…

You have to use this on the server side the init.lua use this hook
[lua]
function Spectate(ply, ent)
timer.Simple(0.5, function()
ply:Spectate( OBS_MODE_CHASE )
ply:SpectateEntity( ent )
end)
end
hook.Add(“PlayerInitialSpawn”, “spec”, Spectate);
[/lua]