Player models & Undo

I don’t feel like i need two threads for this. Basically on my server setting player models does not work and players can’t undo NPC’s. stuff that might be the cause:



function GAMEMODE:PlayerSpawn( ply )
  hook.Call( "PlayerLoadout", GAMEMODE, ply )
  player_manager.RunClass( ply, "SetModel" )
  if ply:GetModel() == "models/player.mdl" then
    ply:SetModel(modelsthing[math.random(1,15)])
  end
end




function GAMEMODE:PlayerSpawnedNPC( ply, model, ent )
  if ent:GetPos():WithinAABox(sppos1, sppos2) and not ent:GetPos():WithinAABox(ignorepos1, ignorepos2) then ply:ChatPrint("Your prop was deleted due to spawn protection!") end
  ent:SetVar("owner", ply)
  ply:AddCount( "npcs", ent )
end


Any ideas?