forked from Simnation/Main
Update main.lua
This commit is contained in:
parent
b32af90162
commit
e9ede0830e
1 changed files with 1 additions and 21 deletions
|
@ -469,29 +469,9 @@ CreateThread(function()
|
||||||
else
|
else
|
||||||
print("[Container Heist] Error: Config.ContainerTypes is nil or empty!")
|
print("[Container Heist] Error: Config.ContainerTypes is nil or empty!")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if Config.ContainerLocations exists and is not empty
|
|
||||||
if Config.ContainerLocations and next(Config.ContainerLocations) then
|
|
||||||
-- Spawn containers at fixed locations if configured
|
|
||||||
for _, location in pairs(Config.ContainerLocations) do
|
|
||||||
if location.spawnContainer then
|
|
||||||
local hash = GetHashKey(location.model)
|
|
||||||
RequestModel(hash)
|
|
||||||
while not HasModelLoaded(hash) do
|
|
||||||
Wait(10)
|
|
||||||
end
|
|
||||||
|
|
||||||
local container = CreateObject(hash, location.coords.x, location.coords.y, location.coords.z, true, false, false)
|
|
||||||
SetEntityHeading(container, location.heading)
|
|
||||||
FreezeEntityPosition(container, true)
|
|
||||||
SetModelAsNoLongerNeeded(hash)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print("[Container Heist] Warning: Config.ContainerLocations is nil or empty!")
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
-- Automatically scan for containers periodically
|
-- Automatically scan for containers periodically
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue