1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-20 19:57:23 +02:00
parent 61b242396c
commit 05a77a6265
3 changed files with 8 additions and 24 deletions

View file

@ -158,8 +158,11 @@ local function StartContainerRobbery(container, containerType)
return
end
-- Generate a unique ID for this container robbery
local containerID = "container_" .. math.random(100000, 999999)
-- Check cooldowns
local cooldownCheck = lib.callback.await('container_heist:server:checkCooldown', false, NetworkGetNetworkIdFromEntity(container))
local cooldownCheck = lib.callback.await('container_heist:server:checkCooldown', false, containerID)
if not cooldownCheck.success then
lib.notify({
title = Config.Notifications.title,
@ -215,7 +218,7 @@ local function StartContainerRobbery(container, containerType)
},
}) then
-- Success
TriggerServerEvent('container_heist:server:finishRobbery', NetworkGetNetworkIdFromEntity(container), containerType.type)
TriggerServerEvent('container_heist:server:finishRobbery', containerID, containerType.type)
lib.notify({
title = Config.Notifications.title,
description = Config.Notifications.success,
@ -234,6 +237,7 @@ local function StartContainerRobbery(container, containerType)
currentContainer = nil
end
-- Function to scan and add all nearby containers to target system
local function ScanAndAddContainersToTarget()
local playerPed = PlayerPedId()