Tweaked networking stuff

master
AlmTech 5 years ago
parent 615bd55ab4
commit 68c2cf2e0c
  1. 6
      gamemode/engine/core/server/sv_player_init.lua
  2. 17
      gamemode/engine/derma/cl_character.lua

@ -16,6 +16,8 @@ end
local function setUpPlayer( ply ) local function setUpPlayer( ply )
Quantum.Server.Char.SetCurrentCharacter( ply, ply.charindex || 1 )
if( ply:GetModel() ~= nil ) then if( ply:GetModel() ~= nil ) then
ply:SetupHands() ply:SetupHands()
else else
@ -26,8 +28,8 @@ end
function GM:PlayerSpawn( ply ) function GM:PlayerSpawn( ply )
if( !ply.isloaded ) then if( ply.isloaded ) then
ply:Spectate( OBS_MODE_CHASE ) ply:Spectate( OBS_MODE_FIXED )
else else
setUpPlayer( ply ) setUpPlayer( ply )
end end

@ -9,7 +9,22 @@ local function char_derma()
local sw, sh = ScrW(), ScrH() local sw, sh = ScrW(), ScrH()
if( !f ) then if( !f ) then
local f = vgui.Create( "DFrame" ) local f = vgui.Create( "DFrame" )
f:SetTitle( "Character Derma" ) f:SetTitle( "Character Menu" )
f:SetSize( sw, sh ) f:SetSize( sw, sh )
local txt = vgui.Create( "DTextEntry" )
txt:SetText( "Enter name here" )
txt:SizeToContents()
txt:SetPos( 100, 100 )
local b = vgui.Create( "DButton" )
b:SetText( "Create char" )
b:SizeToContents()
b.DoClick = function()
net.Start( "quantum_menu_button_net" )
net.WriteString( "createchar" )
net.WriteTable( { name = txt:GetValue() } )
net.SendToServer()
end
end end
end end
Loading…
Cancel
Save