interiorPositions = {
    --Vector3(1774.1278076172, -2036.7473144531, 13.516473770142),
    --Vector3(1780.4099121094, -2032.9714355469, 13.506021499634),

    Vector3(1180.3186035156, -1227.12109375, 18.5546875),
    Vector3(1180.4255371094, -1254.9686279297, 18.890762329102),
    Vector3(1142.6934814453, -1093.1544189453, 28.1875),
    Vector3(1059.1348876953, -1105.8471679688, 28.045097351074),
    Vector3(1326.4940185547, -1067.7713623047, 31.5546875),
    Vector3(1410.4484863281, -920.86395263672, 38.421875),
    Vector3(2156.4340820313, -1071.8416748047, 39.892322540283),
    Vector3(2189.1657714844, -1082.3471679688, 43.71798324585),
    Vector3(2492.1403808594, -1239.4018554688, 37.905414581299),
    Vector3(2623.2749023438, -1229.4075927734, 53.6796875),
    Vector3(2756.1145019531, -1181.2739257813, 69.396560668945),
    Vector3(2379.3024902344, -1785.3245849609, 13.546875),
    Vector3(2139.0515136719, -1698.7196044922, 15.078443527222),
    Vector3(2015.0573730469, -1716.3861083984, 13.554683685303),
    Vector3(1980.8337402344, -1719.1217041016, 17.030546188354),
    Vector3(1974.8746337891, -1633.9481201172, 18.568988800049),
    Vector3(1910.0405273438, -1598.6123046875, 14.306245803833),
    Vector3(1733.8572998047, -2098.4931640625, 14.036639213562),
    Vector3(1734.7786865234, -2129.8330078125, 14.021014213562),
    Vector3(653.37469482422, -1714.0015869141, 14.764795303345),
    Vector3(693.7919921875, -1705.6888427734, 3.8194825649261),
    Vector3(766.55810546875, -1605.8216552734, 13.803857803345),
    Vector3(776.74932861328, -1036.4920654297, 24.280162811279),
    Vector3(1539.3583984375, -850.63360595703, 64.336059570313),
    Vector3(1527.392578125, -772.83215332031, 80.578125),
    Vector3(1045.1990966797, -641.50463867188, 120.1171875),
    Vector3(899.31793212891, -678.45922851563, 116.89044189453),
    Vector3(612.06115722656, -1085.1260986328, 58.826656341553),
    Vector3(558.00317382813, -1160.3405761719, 54.422348022461),
    Vector3(471.37704467773, -1165.0932617188, 67.104080200195),
    Vector3(143.31050109863, -1469.8317871094, 25.203598022461),
    Vector3(192.73179626465, -1770.0645751953, 4.3098516464233),
    Vector3(206.85011291504, -1769.9849853516, 4.3514657020569),
    Vector3(315.59652709961, -1770.8446044922, 4.6739902496338),
    Vector3(507.65646362305, -1607.9738769531, 16.399541854858),
    Vector3(1667.7175292969, -1409.0828857422, 13.546875),
    Vector3(1677.1224365234, -1462.2873535156, 13.553773880005),
    Vector3(1690.8911132813, -1458.6156005859, 13.546875),
    Vector3(1685.8314208984, -1462.8481445313, 13.546875),
    Vector3(2153.7243652344, -1242.1051025391, 25.285774230957),
    Vector3(2230.2385253906, -1281.5659179688, 25.3671875),
    Vector3(2250.2082519531, -1280.4144287109, 25.4765625),
    Vector3(2155.7182617188, -1071.4547119141, 39.598827362061),
    Vector3(1539.2835693359, -851.69604492188, 64.336059570313),
    Vector3(2230.2404785156, -1281.2709960938, 25.3671875),
    Vector3(848.34655761719, -744.78546142578, 94.969268798828),
}

interiorFurnitures = {
    {int = 1, exitPos = Vector3(223.29350280762, 1287.3668212891, 1082.140625), furnitures = {
        --{pos = Vector3(224.10424804688, 1293.259765625, 1081.140625), rot = 0, objID = 1712},  
        --{pos = Vector3(226.64971923828, 1287.931640625, 1081.140625), rot = 213, objID = 1735},
        --{pos = Vector3(224.11132202148, 1291.3823242188, 1081.140625), rot = 0, objID = 2311},
        --{pos = Vector3(230.59992675781, 1289.1170654297, 1081.140625), rot = -90, objID = 1725},

        {pos = Vector3(226.64971923828, 1287.931640625, 1081.140625), rot = 213, objID = 1735},
        --{pos = Vector3(226.64971923828, 1287.931640625, 1081.140625), rot = 213, objID = 1735},
        --{pos = Vector3(226.64971923828, 1287.931640625, 1081.140625), rot = 213, objID = 1735},
        --{pos = Vector3(226.64971923828, 1287.931640625, 1081.140625), rot = 213, objID = 1735},

        {pos = Vector3(224.11132202148, 1291.3823242188, 1081.140625), rot = 0, objID = 2311},
        --{pos = Vector3(224.11132202148, 1291.3823242188, 1081.140625), rot = 0, objID = 2311},
        --{pos = Vector3(224.11132202148, 1291.3823242188, 1081.140625), rot = 0, objID = 2311},
        --{pos = Vector3(224.11132202148, 1291.3823242188, 1081.140625), rot = 0, objID = 2311},

        {pos = Vector3(224.10424804688, 1293.259765625, 1081.140625), rot = 0, objID = 1712},  
        --{pos = Vector3(224.10424804688, 1293.259765625, 1081.140625), rot = 0, objID = 1712},  
        --{pos = Vector3(224.10424804688, 1293.259765625, 1081.140625), rot = 0, objID = 1712},  
    }},

    {int = 1, exitPos = Vector3(2216.5400, -1076.2900, 1050.4840), furnitures = {
        {pos = Vector3(2213.8962402344, -1078.1451416016, 1049.484375), rot = 180, objID = 1735},
        {pos = Vector3(2203.4738769531, -1077.0268554688, 1049.484375), rot = 133, objID = 1735},
        {pos = Vector3(2205.7231445313, -1075.2567138672, 1049.484375), rot = 133, objID = 1819},
    }},

    {int = 2, exitPos = Vector3(225.756, 1240.00, 1082.149), furnitures = {
        {pos = Vector3(220.1854095459, 1240.1723632813, 1081.140625), rot = 131, objID = 1768},
        {pos = Vector3(222.23989868164, 1242.3852539063, 1081.140625), rot = 131, objID = 2311},
        {pos = Vector3(224.68453979492, 1246.0125732422, 1081.140625), rot = -45, objID = 1769},
        {pos = Vector3(222.08346557617, 1246.3403320313, 1081.140625), rot = 20, objID = 1769},
        {pos = Vector3(224.40615844727, 1239.1473388672, 1081.140625), rot = -120, objID = 1769},
    }},

    {int = 4, exitPos = Vector3(-261.95300292969, 1456.6585693359, 1084.3671875), furnitures = {
        {pos = Vector3(-279.27359008789, 1449.4990234375, 1083.3671875), rot = 90, objID = 1753},
        {pos = Vector3(-278.37847900391, 1453.3874511719, 1083.3671875), rot = 38, objID = 1754},
        {pos = Vector3(-278.70953369141, 1447.9871826172, 1083.3671875), rot = 124, objID = 1754},
        {pos = Vector3(-274.01138305664, 1448.8948974609, 1083.3671875), rot = -130, objID = 1754},
        {pos = Vector3(-275.78842163086, 1450.9764404297, 1083.3671875), rot = 133, objID = 1819},
    }},

    {int = 4, exitPos = Vector3(221.96751403809, 1141.2042236328, 1082.609375), furnitures = {
        {pos = Vector3(219.77465820313, 1159.2424316406, 1081.609375), rot = 0, objID = 1712},
        {pos = Vector3(219.19596862793, 1154.4088134766, 1081.6168212891), rot = 133, objID = 1735},
        {pos = Vector3(221.67175292969, 1156.2960205078, 1081.609375), rot = 100, objID = 1819},
    }},

    {int = 5, exitPos = Vector3(22.79996, 1404.642, 1084.43), furnitures = {
        {pos = Vector3(29.286573410034, 1417.8405761719, 1083.4296875), rot = 0, objID = 1703},
        {pos = Vector3(32.530387878418, 1411.0720214844, 1083.4296875), rot = -140, objID = 1704},
        {pos = Vector3(30.294235229492, 1410.7490234375, 1083.4296875), rot = 137, objID = 1704},
        {pos = Vector3(27.622472763062, 1416.8692626953, 1083.4296875), rot = 35, objID = 1704},
        {pos = Vector3(32.61812210083, 1417.1533203125, 1083.4296875), rot = -57, objID = 1704},
        {pos = Vector3(31.212675094604, 1412.7725830078, 1083.4296875), rot = 137, objID = 1815},
    }},

    {int = 6, exitPos = Vector3(2196.0681152344, -1204.3856201172, 1049.0234375), furnitures = {
        {pos = Vector3(2196.0012207031, -1202.2369384766, 1048.0234375), rot = -87, objID = 1705},
        {pos = Vector3(2189.4697265625, -1204.3083496094, 1048.0234375), rot = 96, objID = 1705},
        {pos = Vector3(2193.5434570313, -1226.4560546875, 1048.0234375), rot = 0, objID = 1208},
    }},

    {int = 6, exitPos = Vector3(-68.951141357422, 1352.2325439453, 1080.2109375), furnitures = {
        {pos = Vector3(-71.092231750488, 1360.4451904297, 1079.2185058594), rot = 136, objID = 1769},
        {pos = Vector3(-64.117736816406, 1362.2030029297, 1079.2185058594), rot = -136, objID = 1768},
        {pos = Vector3( -71.529144287109, 1363.6879882813, 1079.2185058594), rot = 90, objID = 1768},
        {pos = Vector3(-64.565399169922, 1366.7280273438, 1079.2185058594), rot = 0, objID = 1769},
        {pos = Vector3(-62.059993743896, 1366.6788330078, 1079.2109375), rot = 180, objID = 1208},
        {pos = Vector3(-61.984001159668, 1353.7397460938, 1079.2185058594), rot = 360, objID = 1208},
        {pos = Vector3(-68.471641540527, 1363.5510253906, 1079.2109375), rot = 375, objID = 2311},
    }},

    {int = 8, exitPos = Vector3(-42.491455078125, 1406.4979248047, 1084.4296875), furnitures = {
        {pos = Vector3(-52.226669311523, 1407.9331054688, 1083.4296875), rot = 90, objID = 1712},
        {pos = Vector3(-49.604698181152, 1412.5061035156, 1083.4296875), rot = 0, objID = 1712},
        {pos = Vector3(-39.060092926025, 1407.6534423828, 1083.4296875), rot = 360, objID = 1208},
        {pos = Vector3(-45.732563018799, 1404.3990478516, 1083.4370117188), rot = -140, objID = 1735},
    }},

    {int = 9, exitPos = Vector3(260.97555541992, 1238.4493408203, 1084.2578125), furnitures = {
        {pos = Vector3(265.1535949707, 1242.78125, 1083.2578125), rot = -90, objID = 1753},
        {pos = Vector3(264.353515625, 1238.5234375, 1083.2652587891), rot = -140, objID = 1754},
        {pos = Vector3(252.60171508789, 1247.2309570313, 1083.2578125), rot = 270, objID = 1208},
        {pos = Vector3(257.13586425781, 1244.3344726563, 1083.2578125), rot = 180, objID = 1735},
        {pos = Vector3(261.98391723633, 1240.8959960938, 1083.2578125), rot = 180, objID = 1819},
    }},
}

attachmentPositions = {
    [2311] = {1, -0.3, 0.3, 90, 90, 70},
    [1712] = {1, -0.3, 0.3, 90, 90, 70},
    [1768] = {1, -0.3, 0.3, 90, 90, 70},
    [1753] = {1, -0.3, 0.3, 90, 90, 70},
    [1703] = {1, -0.3, 0.3, 90, 90, 70},
    [1735] = {0.2, 0, 0.3, 90, 90, 70},
    [1208] = {0.2, 0, 0.2, 90, 90, 70},
    [1769] = {0.5, -0.3, 0.3, 90, 90, 70},
    [1754] = {0.2, -0.2, 0.3, 90, 90, 70},
    [1704] = {0.5, -0.2, 0.3, 90, 90, 70},
    [1705] = {0.5, -0.2, 0.3, 90, 90, 70},
    [1725] = {2, -1, 1.3, 0, 90, 70},
    [1819] = {0.5, -0.2, 0.7, 0, 90, 70},
    [1815] = {0.5, -0.2, 0.9, 0, 90, 70},
}

attachmentPositionsVehicle = {
    [1735] = {0, 0.5, -0.3, 0, 0, 0},
    [1208] = {0, 0.5, -0.3, 0, 0, 180},
    [1769] = {-0.5, 0.5, -0.35, 0, 0, 0},
    [1754] = {0, 0.5, -0.35, 0, 0, 0},
    [1704] = {-0.5, 0.5, -0.35, 0, 0, 0},
    [1705] = {-0.5, 0.5, -0.35, 0, 0, 0},
    [2311] = {0, -1, -0.3, 0, 0, 90},
    [1712] = {0, -1, -0.3, 0, 0, 90},
    [1768] = {0, -1.5, -0.3, 0, 0, 90}, --
    [1753] = {0, -1.5, -0.3, 0, 0, 90},
    [1703] = {0, -1.5, -0.3, 0, 0, 90},
    [1819] = {0.5, -0.3, -0.3, 0, 0, 90},
    [1815] = {0.5, -0.3, -0.3, 0, 0, 90},
}

objectTypes = {
    [1712] = "couch",
    [1768] = "couch",
    [1753] = "couch",
    [1703] = "couch",

    [1735] = "chair",
    [1769] = "chair",
    [1754] = "chair",
    [1704] = "chair",
    [1705] = "chair",

    [2311] = "table",
    [1819] = "table",
    [1815] = "table",

    [1208] = "wash",
}

objectNames = {
    ["couch"] = "Kanapé",
    ["chair"] = "Fotel/Szék",
    ["table"] = "Asztal",
    ["wash"] = "Mosógép",
}

objectSizes = {
    [1735] = {0, 0.9, 1.7},
    [1769] = {0, 0.5, 1.4},
    [1754] = {0, 0.85, 1.4}, -- 
    [1704] = {0, 0.5, 1.85},
    [1705] = {0, 0.5, 1.85},
    [1819] = {0, 1.4, 0.5},
    [1208] = {0, 0.85, 0.9},
    [1815] = {0, 1.4, 0.5},
    [2311] = {0, 2.4, 0.5},
    [1712] = {0, 2.4, 1},
    [1768] = {0, 2.75, 1}, 
    [1753] = {0, 3, 1},
    [1703] = {0, 3, 1},
}

customMarker = exports.oCustomMarker
core = exports.oCore
color, r, g, b = core:getServerColor()
infobox = exports.oInfobox

function spairs(t, order)
    -- collect the keys
    local keys = {}
    for k in pairs(t) do keys[#keys+1] = k end

    -- if order function given, sort by it by passing the table and keys a, b,
    -- otherwise just sort the keys 
    if order then
        table.sort(keys, function(a,b) return order(t, a, b) end)
    else
        table.sort(keys)
    end

    -- return the iterator function
    local i = 0
    return function()
        i = i + 1
        if keys[i] then
            return keys[i], t[keys[i]]
        end
    end
end

text_wait = 60

texts = {
    ["start"] = {
        "Azt hittem már sosem kezdesz el dolgozni...",
        "Mellesleg üdvözöllek!",
        "Már várnak rád az első háznál.",
        "Jó munkát kívánok! Legyél minnél gyorsabb és csak óvatosan a bútorokkal!",
    },

    ["normal"] = {
        "Na végre, visszatértél...",
        "Már várnak rád a következő helyen.",
        "Jó munkát kívánok! Vigyázz a bútorokra!",
    },
}

carryToggleControlls = {"fire", "jump", "sprint", "crouch", "enter_exit"}