Disable Player Initial Spawn

Hi, i just want to know how to make it so when a player joins instead of just autospawning they have to go through some derma menu first. if this is on the wiki sorry but any link is helpful. Oh and first post!


function FirstSpawn( ply )
    ply:PrintMessage(HUD_PRINTCENTER,"Welcome to the server!")
hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn )


function ShowDerma()
     local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
     DermaPanel:SetPos( 50,50 ) -- Position on the players screen
     DermaPanel:SetSize( 1000, 900 ) -- Size of the frame
     DermaPanel:SetTitle( "Testing Derma Stuff" ) -- Title of the frame
     DermaPanel:SetVisible( true )
     DermaPanel:SetDraggable( true ) -- Draggable by mouse?
     DermaPanel:ShowCloseButton( true ) -- Show the close button?
     DermaPanel:MakePopup() -- Show the frame

That doesn’t prevent them from spawning. You can kill them silently as soon as they spawn using **[Player.KillSilent

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.KillSilent)**, and then hook **[Gamemode.PlayerDeathThink

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerDeathThink)** to prevent them from respawning by pressing a key.

There really is no need to prevent them from spawning if your goal is to just have them go through derma menu’s before they cant enter the game. That just overcomplicates it. The Derma menu wont let them move until they close the menu so just disable the X button.

In team-based games, it’s preferable for the player not to spawn at all rather than spawning in some arbitrary team in some arbitrary place. Now if the OP simply wanted to display a MOTD-style Derma window, that’s obviously not needed.

Thanks for all your help!