if SERVER then
    AddCSLuaFile()
end

local MAPSCRIPT = {}
MAPSCRIPT.PlayersLocked = false

MAPSCRIPT.DefaultLoadout = {
    Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1"},
    Ammo = {
        ["Pistol"] = 18,
        ["SMG1"] = 45
    },
    Armor = 0,
    HEV = true
}

MAPSCRIPT.InputFilters = {}
MAPSCRIPT.EntityFilterByClass = {}

MAPSCRIPT.EntityFilterByName = {
    ["global_newgame_spawner_suit"] = true,
    ["global_newgame_spawner_crowbar"] = true,
    ["global_newgame_spawner_pistol"] = true,
    ["global_newgame_spawner_smg"] = true,
    ["global_newgame_spawner_smg"] = true,
    ["global_newgame_ammo"] = true,
}

MAPSCRIPT.Checkpoints = {
    { -- After airboat jump puzzle
        Pos = Vector(352, 5984, -141),
        Ang = Angle(0, 90, 0),
        Vehicle = {
            Pos = Vector(-405.258606, 5841.114258, -212.960327),
            Ang = Angle(0, 0, 0)
        },
        Trigger = {
            Pos = Vector(140.128403, 6230.728516, -91.836014),
            Mins = Vector(-650, -500, -150),
            Maxs = Vector(400, 100, 180)
        }
    }
}

function MAPSCRIPT:PostInit()
    -- Leave this here for now if vehicle checkpoint doesnt work
    --if SERVER then
        -- 140.128403 6230.728516 -91.836014
        --local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-244.051270, 5727.869141, -237.508698), Angle(0, 90, 0))
        --checkpoint1:SetVisiblePos(Vector(236.710632, 6244.615234, -75.189445))
        --local checkpointTrigger1 = ents.Create("trigger_once")
        --checkpointTrigger1:SetupTrigger(Vector(140.128403, 6230.728516, -91.836014), Angle(0, 0, 0), Vector(-550, -500, -150), Vector(350, 100, 180))

        --checkpointTrigger1.OnTrigger = function(_, activator)
        --    GAMEMODE:SetVehicleCheckpoint(Vector(-405.258606, 5841.114258, -212.960327), Angle(0, 0, 0))
        --    GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator)
        --end
    --end
end

function MAPSCRIPT:PostPlayerSpawn(ply)
    --DbgPrint("PostPlayerSpawn")
end

return MAPSCRIPT