Help: Playermodel to SteamID in TTT displays ERROR

I want to have certain players to have different player models in a TTT server, currently I have got as far as a player showing ERROR as their player model in the game.

In TTT, gamemode/player.lua I have edited the coding to be:


local models = {
    ["STEAM_0:0:5164803"] = "models/batman/slow_pub_v2.mdl",
    ["STEAM_0:0:25940654"] = "models/catwoman/slow_dark_pub_v2.mdl",
}
 
function GM:PlayerSetModel(ply)
    local mdl = models[ply:SteamID()] or GAMEMODE.playermodel or "models/player/phoenix.mdl";
    util.PrecacheModel(mdl)
    ply:SetModel(mdl)
end

And in lua/autorun/server i have made a new lua file that has this in it:


function AddDir(dir)
	local list = file.FindDir("../"..dir.."/*")
	for _, fdir in pairs(list) do
		if fdir != ".svn" then
			AddDir(dir.."/"..fdir)
		end
	end
 
	for k,v in pairs(file.Find(dir.."/*", true)) do
		resource.AddFile(dir.."/"..v)
	end
end
 
//Models
AddDir("models/batman")
AddDir("models/catwoman")
AddDir("models/spawn")
AddDir("models/player")
AddDir("models/cpt_marvel")
AddDir("models/darksied")
AddDir("models/dark_kahn")
AddDir("models/flash")
AddDir("models/green_lantern")
AddDir("models/Harley_quinn")
AddDir("models/joker")
AddDir("models/kingpin")
AddDir("models/moon_knight")
AddDir("models/robocop")
AddDir("models/robocop_chrome")
AddDir("models/rorschach")
AddDir("models/scarecrow")
AddDir("models/superman")
AddDir("models/venom_wos")
AddDir("models/wolverine")

//Mats
AddDir("materials/models/player/slow/arkham_asylum")
AddDir("materials/models/player/slow/jamis")
AddDir("materials/models/player/slow/robocop")
AddDir("materials/models/player/slow/robocop_chrome")
AddDir("materials/models/player/slow/rorschach_norain_v2")
AddDir("materials/models/player/slow/rorschach_v2")
AddDir("materials/models/player/slow/spawn")

When connecting to the server it forces the client to download the files but when in game the model shows the Red ERROR everyone knows.
Attempting to use resource.AddFile instead of AddDir seemed to make no difference. Hope you can help!

Don’t the models defaulty go into models/player/…?