2025-08-09 03:10:00 -06:00
|
|
|
|
|
|
|
|
local function spawn()
|
2026-01-18 01:20:44 -07:00
|
|
|
local data = Bridge.Callback.Trigger('md-drugs:server:GetMerchant')
|
2025-08-09 03:10:00 -06:00
|
|
|
local model = 's_m_m_trucker_01'
|
2026-01-18 01:20:44 -07:00
|
|
|
requestModel(model)
|
2025-08-11 16:49:24 -06:00
|
|
|
local ped = CreatePed(4, model, data.loc.x, data.loc.y, data.loc.z, data.loc.w, false, true)
|
|
|
|
|
Freeze(ped, true, data.loc.w)
|
2026-01-18 01:20:44 -07:00
|
|
|
Bridge.Target.AddLocalEntity(ped, {
|
2025-08-09 03:10:00 -06:00
|
|
|
{
|
2026-01-23 03:41:19 -07:00
|
|
|
icon = Bridge.Language.Locale('merchant.targetIcon'),
|
2026-01-16 02:57:26 -07:00
|
|
|
label = Bridge.Language.Locale('merchant.targetOpen'),
|
2025-08-09 03:10:00 -06:00
|
|
|
action = function()
|
|
|
|
|
local options = {}
|
2025-08-11 16:49:24 -06:00
|
|
|
for k, v in pairs (data.items) do
|
2026-01-18 01:20:44 -07:00
|
|
|
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
2025-08-09 03:10:00 -06:00
|
|
|
options[#options+1] = {
|
2026-01-18 01:20:44 -07:00
|
|
|
title = itemInfo.label,
|
2025-08-09 03:10:00 -06:00
|
|
|
description = '$'..v,
|
2026-01-18 01:20:44 -07:00
|
|
|
icon = itemInfo.image,
|
2026-01-30 00:45:03 -07:00
|
|
|
onSelect = function()
|
2025-08-14 12:35:09 -07:00
|
|
|
TriggerServerEvent('md-drugs:server:purchaseGoods', k)
|
2025-08-09 03:10:00 -06:00
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
2026-01-18 01:20:44 -07:00
|
|
|
Bridge.Menu.Open({
|
|
|
|
|
id = 'merchant_menu',
|
|
|
|
|
title = Bridge.Language.Locale('merchant.menuTitle'),
|
|
|
|
|
options = options
|
|
|
|
|
})
|
2025-08-09 03:10:00 -06:00
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
spawn()
|