SuR.Config.Loot_SpawnPositions = {
    Vector(1293,1503,1),
    Vector(1284,1272,1),
    Vector(567,1425,1),
    Vector(569,1103,1),
    Vector(1264,1019,1),
    Vector(1161,715,2),
    Vector(1421,698,1),
    Vector(454,793,1),
    Vector(226,782,1),
    Vector(678,875,1),
    Vector(1130,1870,1),
    Vector(1470,1852,1),
    Vector(611,1619,1),
    Vector(577,1935,1),
    Vector(1398,1822,353),
    Vector(1388,1458,353),          
}

SuR.Config.Support_SpawnPositions = {
    Vector(-377,2513,-7),
    Vector(-382,1365,-7),
    Vector(-390,-48,-7),
    Vector(1800,-37,1),         
}

SuR.Config.Gas_SpawnPositions = {
    Vector(2085,2988,1),
    Vector(2092,1611,1),
    Vector(2072,-405,1),    
}

SuR.Config.Camera_Position = {
    Vector(-244,1045,149),
    Angle(-16,-32,0),
}

SuR.Config.Player_SpawnPositions = {
    Vector(1382,596,1),
    Vector(1381,674,1),
    Vector(1380,759,1),
    Vector(1379,832,1),
    Vector(1432,833,1),
    Vector(1433,759,1),
    Vector(1434,691,1),
    Vector(1435,596,1),
}

SuR.Config.Height_Of_Air = 450

SuR.Config.Zombie_Spawn_Radius_Min = 400
SuR.Config.Zombie_Spawn_Radius_Max = 4000

SuR.Config.Loot_Remove_Delay = 180
SuR.Config.Loot_Max_Per_Player = 15

table.insert(SuR.Config.SecondaryWeapons, "tfa_private_glock19")
SuR.Config.TierWeapons["Tier1"] = {"tfa_private_glock19"}

SuR.Config.Open_Func_Doors = true

SuR.Config.Exfil_Points = {
    {
        ["Main"] = Vector(-535,2128,-515),
        [1] = {pos = Vector(1612,-200,700), ang = Angle(0,155,0), wait = false, sec = 0, dist = 0, damp = 0.5},
        [2] = {pos = Vector(-457,1699,500), ang = Angle(0,90,0), wait = false, sec = 10, dist = 200, damp = 0.5, smoothrotate = true},
        [3] = {pos = Vector(-358,2243,265), ang = Angle(0,90,0), wait = true, sec = 3, dist = 50, damp = 0.9, smoothrotate = true},
        [4] = {pos = Vector(-605,2131,450), ang = Angle(0,90,0), wait = false, sec = 6, dist = 100, damp = 0.9},
        [5] = {pos = Vector(1432,2737,700), ang = Angle(20,0,0), wait = false, sec = 5, dist = 300, damp = 1, smoothrotate = true},
    },
}

SuR.Config.Deploy_Cutscene = {
    cam = {
        {
            pos = Vector(832,973,64),
            ang = Angle(2,53,0),
            fov = 65,
            time = 4,
        },
        {
            pos = Vector(927,1399,72),
            ang = Angle(1,119,0),
            fov = 80,
            time = 4,
        },
        {
            pos = Vector(668,1450,99),
            ang = Angle(10,-121,20),
            fov = 70,
            time = 4,
        },
        {
            pos = Vector(568,1456,44),
            ang = Angle(-2,-93,0),
            fov = 80,
            time = 4,
        },
    },
    model = {
        {
            pos = Vector(714,1267,1),
            ang = Angle(0,137,0),
        },
        {
            pos = Vector(659,1221,1),
            ang = Angle(0,112,0),
        },
        {
            pos = Vector(564,1161,1),
            ang = Angle(0,93,0),
        },
        {
            pos = Vector(468,1222,1),
            ang = Angle(-0,67,1),
        },
        {
            pos = Vector(422,1305,1),
            ang = Angle(0,42,0),
        },
    },
}

local models = {
    "models/kerry/nypd_v2/male_04.mdl",
    "models/kerry/nypd_v2/male_05.mdl",
    "models/kerry/nypd_v2/male_06.mdl",
    "models/kerry/nypd_v2/male_07.mdl",
    "models/kerry/nypd_v2/male_08.mdl",
    "models/kerry/nypd_v2/male_09.mdl",
}

SuR.Config.Allowed_PlayerModels = models

---CODE PART---

local positions = {
    Vector(1088,1102,1),
    Vector(620,1128,1),
    Vector(646,843,1),
    Vector(972,399,1),
    Vector(834,654,1),
    Vector(828,1907,1),
    Vector(1139,2279,1),
    Vector(844,1846,353),
}

hook.Add("PlayerSpawn", "SuR.ChangeModels", function(ply)
    timer.Simple(0.001, function()
        if !IsValid(ply) or !ply:Alive() or ply:IsZombie() then return end
        ply:SetBodygroup(3, math.random(0,1))
        ply:SetBodygroup(1, math.random(0,3))
        ply:StripWeapons()
        ply:Give("tfa_private_glock19")
        ply:Give("tfa_nmrih_wrench")
    end)
end)

hook.Add("EntityRemoved", "SuR.OfficerDown", function(ent)
    if ent:GetClass() == "sur_support_npc" and math.random(1,2) == 1 and SERVER then
        SuR:PlaySoundOnClient("sur_config/officerdown.wav")
    end
end)

hook.Add("SuR.GameState", "SuR.SpawnNPCs", function(state)
    if state then
        timer.Simple(0.01, function()
            for k, v in ipairs(positions) do
                local ent = ents.Create("sur_support_npc")
                ent.Model = models
                ent:SetPos(v)
                ent:SetAngles(Angle(0,math.random(0,360),0))
                ent:Spawn()
                ent:SetHealth(50)
                ent:SetBodygroup(3, math.random(0,1))
                ent:SetBodygroup(5, math.random(0,1))
                ent:SetBodygroup(1, math.random(0,3))
                ent:Give("weapon_vj_glock17")
            end

            for k, v in pairs(ents.FindByClass("*door*")) do
                v:Remove()
            end

            for i=1,40 do
                local ent = ents.Create("prop_physics")
                ent:SetModel("models/props_wasteland/dockplank01b.mdl")
                ent:SetPos(Vector(1013,1167,355)+Vector(0,0,i*6))
                ent:Spawn()
                ent:GetPhysicsObject():SetMass(100)
            end
        end)
    end
end)