Fixed player spawning when changing character

master
AlmTech Software 5 years ago
parent b28192f549
commit d15cc3163c
  1. 3
      gamemode/engine/core/server/sv_player_spawning.lua
  2. 3
      gamemode/engine/core/sh_player_binds.lua
  3. 1
      gamemode/engine/lib/server/sv_character.lua
  4. 5
      gamemode/settings/sv_settings.lua

@ -40,5 +40,8 @@ hook.Add( "PlayerSpawn", "Quantum_Player_Respawn", function( pl )
Quantum.Debug( "Respawning player at nearest spawnpoint." ) Quantum.Debug( "Respawning player at nearest spawnpoint." )
pl:SetPos( spawnpos ) pl:SetPos( spawnpos )
pl:SetAngles( spawnangle ) pl:SetAngles( spawnangle )
elseif( pl.isloaded ) then
pl:SetPos( Quantum.Server.Settings.InitSpawnLocation.pos )
pl:SetAngles( Quantum.Server.Settings.InitSpawnLocation.ang )
end end
end) end)

@ -23,8 +23,7 @@ if SERVER then
function GM:KeyRelease( ply, key ) function GM:KeyRelease( ply, key )
if( keyfuncs[key] ) then keyfuncs[key]( ply ) end if( keyfuncs[key] ) then keyfuncs[key]( ply ) end
end end
function GM:ShowHelp( ply ) keyfuncs["openCharMenu"]( ply ) end function GM:ShowHelp( ply ) keyfuncs["mainMenu"]( ply ) end
function GM:ShowTeam( ply ) keyfuncs["mainMenu"]( ply ) end
function GM:ShowSpare2( ply ) keyfuncs["intro"]( ply ) end function GM:ShowSpare2( ply ) keyfuncs["intro"]( ply ) end
end end

@ -60,6 +60,7 @@ end
local function setupCharacter( pl, char ) local function setupCharacter( pl, char )
pl.isloaded = true pl.isloaded = true
pl.deathpos = nil
pl:Spawn() pl:Spawn()
pl:SetMaxHealth( char.maxhealth ) pl:SetMaxHealth( char.maxhealth )
pl:SetHealth( char.health ) pl:SetHealth( char.health )

@ -18,6 +18,11 @@ Quantum.Server.Settings.Inventory = {
Width = 5 Width = 5
} }
Quantum.Server.Settings.InitSpawnLocation = {
pos = Vector( 5054.682617, 3152.809326, 168.031250 ),
ang = Angle( 3.009660, 89.639153, 0.000000 )
}
Quantum.Server.Settings.SpawnLocations = { Quantum.Server.Settings.SpawnLocations = {
["rp_truenorth_v1a_livin"] = { ["rp_truenorth_v1a_livin"] = {

Loading…
Cancel
Save