forked from Simnation/Main
ed
This commit is contained in:
parent
61b242396c
commit
05a77a6265
3 changed files with 8 additions and 24 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue