Going in Cover with 'Q'

I have discovered a bug where you can’t go in cover anymore, since I have tested now for hours, it is a fact that this has to be bug.
So the bug get’s produced by a resource, the resource itself works fine but it disables somehow the cover function from gta. I have tested the bug on a OneSync and a non OneSync server and had both times the same problem.
for a reproduce you only need the resource code, that I’ll provide here:

Citizen.CreateThread(function()
	local modelTable = {}

	for _, item in pairs(Config.Locations) do
		modelTable[item.model] = GetHashKey(item.model)
		
		RequestModel(modelTable[item.model])
	
		while not HasModelLoaded(modelTable[item.model]) do
			Wait(0)
		end

		local npc = CreatePed(4, modelTable[item.model], item.x, item.y, item.z, item.heading, false, true)
			
		SetEntityHeading(npc, item.heading)
		FreezeEntityPosition(npc, true)
		SetEntityInvincible(npc, true)
		SetBlockingOfNonTemporaryEvents(npc, true)
	end

	for k, v in pairs(modelTable) do
		SetModelAsNoLongerNeeded(v)
		modelTable[k] = nil
	end
end)

I have tested to run the code without spawning the ped (commenting it) and it worked fine again. So the ped does the bug, but I don’t know why…

heres the config:

config
Config = {}

-------------------------------------RANDOMSHOPS-------------------------------------
Config.Locations = { -- Some Shop & Interior NPCs
	{ model = "a_m_y_business_03", x = 241.06,   y = -1378.91, z = 32.74, heading = 148.30 },	-- esx_dmvschool
	{ model = "a_m_y_business_03", x = 262.43,   y = -1360.00, z = 23.55, heading = 47.15 },    -- Central Hospital Main
	{ model = "a_m_y_business_03", x = 265.91,   y = -1358.64, z = 23.55, heading = 316.30 },    -- Central Hospital Main 2
	{ model = "a_m_y_business_03", x = 440.85,   y = -978.41,  z = 29.69, heading = 165.95 },    -- PD Main Welcome
	{ model = "a_m_y_business_03", x = 458.97,   y = -1017.28, z = 27.16, heading = 93.50 },    -- PD Main Garage
	{ model = "a_m_y_business_03", x = -1117.15, y = -503.20,  z = 34.81, heading = 294.48 },    -- Moneywash Moveact
	{ model = "a_m_y_business_03", x = -47.14,   y = -1758.82, z = 28.42, heading = 46.58 },    -- LT Gasoline2
	{ model = "a_m_y_business_03", x = 1960.20,  y = 3739.33,  z = 31.34, heading = 296.50 },    -- 24/7 Sandy Shores
	{ model = "a_m_y_business_03", x = -1196.19, y = -892.78,  z = 13.00, heading = 300.42 },    -- Burgershot
	{ model = "a_m_y_business_03", x = -32.94,   y = -1103.65, z = 25.42, heading = 77.25 },    -- Cardealer1
	{ model = "a_m_y_business_03", x = 1224.68,  y = 2728.74,  z = 37.01, heading = 178.82 },    -- Cardealer2
	{ model = "a_m_y_business_03", x = 1133.87,  y = -983.21,  z = 45.42, heading = 274.80 },    -- EL Rancho Robs Li
	{ model = "a_m_y_business_03", x = 408.06,   y = -1623.68, z = 28.29, heading = 219.45 },    -- Vehicle Impound
	{ model = "a_m_y_business_03", x = 24.20,    y = -1347.60, z = 28.50, heading = 271.32 },    -- Strawberry 24/7
	{ model = "a_m_y_business_03", x = 1165.09,  y = -323.51,  z = 68.21, heading = 93.72 },    -- LT Gasoline3
	{ model = "a_m_y_business_03", x = 1727.62,  y = 6415.18,  z = 34.04, heading = 241.98 },    -- Chilliad Freeway 24/7
	{ model = "a_m_y_business_03", x = -2966.12, y = 391.35,   z = 14.04, heading = 77.04 },    -- Ocean Freeway LT Gasoline5
	{ model = "a_m_y_business_03", x = -1819.51, y = 793.72,   z = 137.08, heading = 134.72 },    -- Ocean Freeway LT Gasoline5
	{ model = "a_m_y_business_03", x = 184.99, y = -920.38,   z = 29.92, heading = 168.73 },      -- Coffe Shop Würfelpark
	{ model = "a_m_y_business_03", x = 209.16, y = -932.31,   z = 29.69, heading = 80.82 },      -- Gemüsen Händler Würfelpark
	{ model = "a_m_y_business_03", x = 198.27, y = -940.1,   z = 29.69, heading = 326.19 },      -- Gemüsen Händler 2 Würfelpark
	{ model = "a_m_y_business_03", x = 190.04, y = -932.21,   z = 29.69, heading = 288.5 },      -- Hotdog 1 Würfelpark
	{ model = "a_m_y_business_03", x = 210.81, y = -938.29,   z = 29.69, heading = 144.53 },      -- Hotdog 2 Würfelpark
	{ model = "a_m_y_business_03", x = -1221.96, y = -908.4,   z = 11.33, heading = 43.93 },      -- Unter Kleider Laden Verpucci Strand
	{ model = "a_m_y_business_03", x = 73.98, y = -1392.3,   z = 28.38, heading = 270.1 },      -- Kleiderladen 1
	{ model = "a_m_y_business_03", x = -822.68, y = -1072,   z = 10.33, heading = 210.24 },      -- Kleiderladen 2
	{ model = "a_m_y_business_03", x = 427.06, y = -806.93,   z = 28.49, heading = 90.8 },      -- Kleiderladen 3
	{ model = "a_m_y_business_03", x = -1193.88, y = -766.98,   z = 16.32, heading = 214.97 },      -- Kleiderladen 4
	{ model = "a_m_y_business_03", x = -1449.07, y = -238.22,   z = 48.81, heading = 46.55 },      -- Kleiderladen 5
	{ model = "a_m_y_business_03", x = -164.93, y = -302.82,   z = 38.73, heading = 250.62 },      -- Kleiderladen 6
	{ model = "a_m_y_business_03", x = 127.01, y = -224.25,   z = 53.56, heading = 69.65 },      -- Kleiderladen 7
	{ model = "a_m_y_business_03", x = 1197.4, y = 2711.69,   z = 37.22, heading = 179.95 },      -- Kleiderladen 8
	{ model = "a_m_y_business_03", x = 612.94, y = 2762.73,   z = 41.09, heading = 274.84 },      -- Kleiderladen 9
	{ model = "a_m_y_business_03", x = -1101.76, y = 2712.15,   z = 18.11, heading = 221.57 },      -- Kleiderladen 10
	{ model = "a_m_y_business_03", x = -3169.37, y = 1043.17,   z = 19.86, heading = 66.03 },      -- Kleiderladen 11
	{ model = "a_m_y_business_03", x = 5.24, y = 6510.79,   z = 30.88, heading = 43.25 },      -- Kleiderladen 12
	{ model = "a_m_y_business_03", x = 1695.55, y = 4822.22,   z = 41.06, heading = 98.49 },      -- Kleiderladen 13
	{ model = "a_m_y_business_03", x = -708.84, y = -151.86,   z = 36.42, heading = 119.55 },      -- Kleiderladen 14
	{ model = "a_m_y_business_03", x = 134.52, y = -1707.83,   z = 28.29, heading = 139.12 },      -- Friseurladen 1
	{ model = "a_m_y_business_03", x = -1284.26, y = -1115.21,   z = 5.99, heading = 89.01 },      -- Friseurladen 2
	{ model = "a_m_y_business_03", x = 1211.44, y = -470.63,   z = 65.21, heading = 74.9 },      -- Friseurladen 3
	{ model = "a_m_y_business_03", x = -821.97, y = -183.44,   z = 36.57, heading = 207.29 },      -- Friseurladen 4
	{ model = "a_m_y_business_03", x = -30, y = -151.73,   z = 56.08, heading = 339.77 },      -- Friseurladen 5
	{ model = "a_m_y_business_03", x = 1930.56, y = 3727.96,   z = 31.84, heading = 208.88 },      -- Friseurladen 6
	{ model = "a_m_y_business_03", x = -277.78, y = 6230.65,   z = 30.7, heading = 44.17 },      -- Friseurladen 7
	{ model = "a_m_y_business_03", x = 22.8, y = -1105.54,   z = 28.8, heading = 159.79 },      -- Waffenladen 1
	{ model = "a_m_y_business_03", x = 810.23, y = -2158.99,   z = 28.62, heading = 0.24 },      -- Waffenladen 2
	{ model = "a_m_y_business_03", x = 842.47, y = -1035.34,   z = 27.19, heading = 0.09 },      -- Waffenladen 3
	{ model = "a_m_y_business_03", x = 253.82, y = -50.45,   z = 68.94, heading = 69.36 },      -- Waffenladen 4
	{ model = "a_m_y_business_03", x = -662.24, y = -933.6,   z = 20.83, heading = 178.65 },      -- Waffenladen 5
	{ model = "a_m_y_business_03", x = 1692.36, y = 3761.01,   z = 33.71, heading = 226.53 },      -- Waffenladen 6
	{ model = "a_m_y_business_03", x = -331.63, y = 6085.14,   z = 30.45, heading = 225.77 },      -- Waffenladen 7
	{ model = "a_m_y_business_03", x = -1118.8, y = 2699.98,   z = 17.55, heading = 221.59 },      -- Waffenladen 8
	{ model = "a_m_y_business_03", x = 2567.76, y = 292.49,   z = 107.73, heading = 0.75 },      -- Waffenladen 9
	{ model = "a_m_y_business_03", x = 306.56, y = -734.18,   z = 28.32, heading = 250.17 },      -- Apotheke
	{ model = "a_m_y_business_03", x = 1839.73, y = 3674.23,   z = 33.28, heading = 210.06 },      -- Apotheke Sandy shores
	{ model = "a_m_y_business_03", x = -406.43, y = 6062.8,   z = 30.5, heading = 130.36 },      -- Apotheke Paleto Bay
	{ model = "a_m_y_business_03", x = -30.98, y = -1106.62,   z = 25.42, heading = 340.37 },      -- Autohaus Kaufvertrag
	{ model = "a_m_y_business_03", x = 2747.96, y = 3472.78,   z = 54.67, heading = 246.08 },      -- Baumarkt
	{ model = "a_m_y_business_03", x = 924.12, y = -941.31,   z = 43.37, heading = 93.89 },      -- Casino
	{ model = "a_m_y_business_03", x = 911.47, y = -962.15,   z = 43.69, heading = 268.41 },      -- Casino 2
	{ model = "a_m_y_business_03", x = -72.17, y = -814.34,   z = 242.39, heading = 159.99 },      -- Maze Bank LeuchTis Sekretär xddd
	{ model = "a_m_y_business_03", x = -40.62, y = -1674.5,   z = 28.48, heading = 136.49 },      -- Muscle Autohändler
	{ model = "a_m_y_business_03", x = 2538.84, y = 2577.48,   z = 36.94, heading = 13.32 },      -- Vans Autohändler
	{ model = "a_m_y_business_03", x = 916.15, y = 3559.83,   z = 32.81, heading = 318.4 },      -- Off Road Autohändler
	{ model = "a_m_y_business_03", x = -223.12, y = 6243.01,   z = 30.49, heading = 42.75 },      -- SUVs Autohändler
	{ model = "a_m_y_business_03", x = 268.67, y = -1155.31,   z = 28.29, heading = 90.23 },      -- Motorrad Händler
	{ model = "a_m_y_business_03", x = 480.6, y = -1321.83,   z = 28.2, heading = 347.3 },      -- Kompakt Autohändler
	{ model = "a_m_y_business_03", x = -140.92, y = -605.33,   z = 166.6, heading = 40.33 },      -- Luxus Autohändler
	{ model = "a_m_y_business_03", x = 442.6, y = -1969.61,   z = 23.4, heading = 312.34 },      -- Garage
	{ model = "s_m_y_dockwork_01", x = 193.08, y = -2503.56,   z = 6.24, heading = 179.5 },      -- sand verkäufer
	{ model = "s_m_y_dockwork_01", x = -127.58, y = 1921.43,   z = 196.31, heading = 356.71 },      -- Meeresfürchten verarb
	{ model = "s_m_y_xmech_01", x = 100.53, y = -1073.3,   z = 28.37, heading = 343.2 },      -- Würfelpark garage
	{ model = "s_m_y_xmech_01", x = -1082.01, y = -1254.27,   z = 4.43, heading = 300.92 },      -- Vespucci garage
	{ model = "s_m_y_xmech_01", x = 363.49, y = 296.84,   z = 102.5, heading = 249.55 },      -- Vinewood garage
	{ model = "s_m_y_xmech_01", x = 1694.6, y = 3611.02,   z = 34.32, heading = 205.12 },      -- Sany Shores garage
	{ model = "s_m_y_xmech_01", x = 107.93, y = 6613.82,   z = 31.01, heading = 224.27 },      -- Paleto Bay garage
	{ model = "a_m_y_business_03", x = -685.62, y = 5793.85,   z = 16.33, heading = 155.64 },      -- Kartoffel verarbeiter
	{ model = "a_m_y_business_03", x = -1161.12, y = 4924.62,   z = 221.8, heading = 254.75 },      -- cihps verkäufer
	{ model = "a_m_y_business_03", x = 3802.21, y = 4441.63,   z = 3.16, heading = 347.77 },      -- meeres früchten verkäufer
	{ model = "a_m_y_business_03", x = 2855.08, y = 1479.87,   z = 23.78, heading = 162.88 },      -- meeres früchten wäscher
	{ model = "a_m_y_business_03", x = -439.72, y = 295.13,   z = 82.33, heading = 87.24 },      -- Mandarine Verkäufer
	{ model = "a_m_y_business_03", x = 1737.88, y = 3898.38,   z = 34.56, heading = 28.13 },      -- Mandarine verarbeiter
	{ model = "a_m_y_business_03", x = 20.65, y = -1104.74,   z = 28.8, heading = 160.04 },      -- Ammunation
	{ model = "a_m_y_business_03", x = -816.35, y = -741.05,   z = 22.8, heading = 179.82 },      -- Autohaus vanilla
	{ model = "a_m_y_business_03", x = -1095.72, y = -2596.04,   z = 12.93, heading = 331.23 },      -- 24/7 laden flughafen
	{ model = "csb_reporter", x = -591.8, y = -932.96,   z = 22.88, heading = 7.07 },      			-- Weazel news
	{ model = "csb_reporter", x = -794.23, y = -219.06,   z = 36.08, heading = 126.28 },      			-- Weazel news
	{ model = "csb_reporter", x = -80.4, y = 6502.1,   z = 30.49, heading = 220.61 },      			-- Weazel news
	
	{ model = "g_m_m_chicold_01", x = 27.79, y = -638.82,   z = 15.09, heading = 82.41 },      			-- Juwelenverkaufer

	{ model = "g_m_y_ballasout_01", x = 3726.65, y = 4539.31,   z = 21.25, heading = 355.69 },
	{ model = "s_m_m_linecook", x = 1779.57, y = 2591.41,   z = 44.8, heading = 179.31 },
	{ model = "g_m_y_ballasout_01", x = 1469.62, y = 6543.65,   z = 13.9, heading = 169.06 },
	{ model = "g_m_y_ballasout_01", x = -1500.01, y = -217.11,   z = 46.89, heading = 36.73 },      -- waffenhändler

	{ model = "s_m_y_construct_01", x = 1073.03,   y = -3102.48, z = -40.01, heading = 89.89 },
	
	{ model = "s_m_m_doctor_01", x = 92.11,   y = -231.08, z = 53.66, heading = 339.6 },
	{ model = "s_m_m_doctor_01", x = 317.92,   y = -1078.37, z = 28.48, heading = 359.7 },
	
	{ model = "csb_reporter", x = -657.23,   y = -858.78, z = 23.49, heading = 356.54 },

}

The code runs well, has no errors or bugs, only the ped spawning part makes the cover function unusable.
Hope you guys see what I mean on your tests and let me know if you could reproduce it or not.
Have a nice day.

EDIT:
This may be important if you start the resource and stop it, it will keep the bug. Only a server restart without starting the resource again, fixes the bug again.

I just found a fix. the config was the problem…
coords like:

are wrong. Coords seem to always need to have a ‘.’
so x = -30.0 is correct. Now that I found that out, i could fix
I would wish that there would be any error feedback for that, it took hours to find that out… :expressionless: