Problems with functions in player classes.

Hey everyone! I just started programming my gamemode again after a long break of not even looking at lua for about a year, so T have spent the last couple of days re-writing my gamemode that i had started. My problem is this: I am trying to assign my player to a class so that loadouts and things of that nature can be automatically assigned. My Problem is that while i am not getting errors at runtime, when i get ingame my loadout is not set to the loadout that i defined in the class. Here is what i have thus far

shared.lua



DeriveGamemode("base")

GM.Name = "Ghosts"
GM.Author = "no dox for u"
GM.Email = "no dox for u"
GM.Website = "N/A"

include("team_setup.lua")

//time to set some generic gamemode settings
//GM.TeamBased = true

//these variables contain our round dime settings, round contains all round vars
//break is the time between rounds, time is time a round lasts,
// and stage is time till the first infection happens
local round = {}
//round states: 0 = waiting, 1 = staging, 2 = playing, 3 = ending
round.State = 0
round.Break = 5
round.RoundLength = 5
round.Stage = 5
round.MinimumPlayersToStart = 1
round.Time = 0

//stuff to do on shared.lua initialization
function GM:Initialize()

	timer.Create("RoundTicker", 1, 0, RoundTick)
	
end

//handle what happens when a player connects
function GM:PlayerConnect( ply, ip )
	
	MsgN(ply .. " has connected from the ip " .. ip)
	
	
end

//a function for printing in the chat
function round.Broadcast(Text)
	for k, v in pairs(player.GetAll()) do
		v:ChatPrint(Text)
	end
end


//wait for enough players
function GameStartTimer()
	
	//see how many players are connected
	if #team.GetPlayers(0) >= round.MinimumPlayersToStart then
		StageRound()
	end
	
end

//start the round staging process
function StageRound()
	
	round.State = 1
	round.Time = round.Stage
	
	round.Broadcast("Round staging has begun!")
	round.TimeLeft = round.StageRound
	
	for k, v in pairs(player.GetAll()) do
		v:ConCommand("Switch_team 1")
		player_manager.SetPlayerClass(v, "human")
	end
	
end

//start the round
function StartRound()
	
	round.State = 2
	round.Time = round.RoundLength
	round.Broadcast("The round has begun!")
	
	//choose a player at random to become the first ghost & set them to ghost team
	local firstGhost = table.Random(player.GetAll())
	//round.Broadcast(" has become the first ghost!")
	firstGhost:ConCommand("Switch_team 2")
	
end

function EndRound()
	
	round.State = 3
	round.Time = round.Break
	
	round.Broadcast("The round has ended")
	
end

//function to be called every tick of the round
function RoundTick()
	
	//this should be uncommented when debugging
	//MsgN("Round Tick")
	
	if round.Time > 0 then
		
		round.Time = round.Time - 1
		MsgN(round.Time)
		
	elseif round.Time <= 0 then
		NextStage()
	end
	
end

function NextStage()
	
	//uncomment when debugging
	//MsgN("NextStage")
	
	if round.State == 0 then
		GameStartTimer()
	elseif round.State == 1 then
		StartRound()
	elseif round.State == 2 then
		EndRound()
	elseif round.State == 3 then
		StageRound()
	else
		error("Invalid Round State")
	end
end


team_setup.lua (this is included into the shared.lua file)


include('player_class/human.lua')


//we must create our 3 teams!
function GM:CreateTeams()
	
	//first our spectator / default team
	team.SetUp(0, "Spectator", Color( 0 , 0 , 0 , 255 ))
	
	//lnext our human team, this is the team that you are on by default on round start
	team.SetUp(1, "Humans", Color( 20, 118, 22, 255 ))
	team.SetClass(1, "human")
	
	//our final team is the infected/ ghosts
	team.SetUp(2, "Ghosts", Color( 118, 20, 20, 0 ))
	team.SetClass(2, "ghost")
end




function GM:PlayerSpawn(ply)
	
	if ply:Team() == 1 then
		ply:SetModel( "models/player/police.mdl" )
		ply:SetColor(Color( 20, 118, 22, 255 ))
		ply:SetRenderMode( RENDERMODE_TRANSALPHA )
		ply:DrawShadow("true")
	elseif ply:Team() == 2 then
		ply:SetModel( "models/player/zombie_fast.mdl" )
		ply:SetColor(Color( 118, 20, 20, 100 ))
		ply:SetRenderMode( RENDERMODE_TRANSALPHA )
		ply:DrawShadow("false")
	elseif ply:Team() == 0 then
		ply:SetRenderMode(RENDERMODE_TRANSALPHA)
		ply:SetColor(Color( 255, 255, 255, 0 ))
		ply:ConCommand("noclip")
	end
	
	player_manager.SetPlayerClass(ply, "human")
	
end


human.lua


AddCSLuaFile()

DEFINE_BASECLASS("player_default")

local PLAYER = {}

PLAYER.DisplayName			= "Human"

PLAYER.WalkSpeed			= 4000		-- How fast to move when not running
PLAYER.RunSpeed				= 600		-- How fast to move when running
PLAYER.CrouchedWalkSpeed	= 0.3		-- Multiply move speed by this when crouching
PLAYER.DuckSpeed			= 0.3		-- How fast to go from not ducking, to ducking
PLAYER.UnDuckSpeed			= 0.3		-- How fast to go from ducking, to not ducking
PLAYER.JumpPower			= 200		-- How powerful our jump should be
PLAYER.CanUseFlashlight		= true		-- Can we use the flashlight
PLAYER.MaxHealth			= 100		-- Max health we can have
PLAYER.StartHealth			= 100		-- How much health we start with
PLAYER.StartArmor			= 0			-- How much armour we start with
PLAYER.DropWeaponOnDie		= false		-- Do we drop our weapon when we die
PLAYER.TeammateNoCollide	= true		-- Do we collide with teammates or run straight through them
PLAYER.AvoidPlayers			= true		-- Automatically swerves around other players
PLAYER.UseVMHands			= true		-- Uses viewmodel hands


function PLAYER:Loadout()

	self.Player:RemoveAllAmmo()

	self.Player:GiveAmmo( 256, 	"Pistol", 		true )
	self.Player:Give( "weapon_smg1" )
	print("wha?")
end

player_manager.RegisterClass( "human", PLAYER, "player_default" )

I’m not sure where to go from this point because i really don’t want to have to give my players all their own models, weapons, etc. with a while bunch of if statememnts if i can avoid it. Thanks for any help you can provide!