2026-01-18 01:20:44 -07:00
|
|
|
local locations = GlobalState.MDDrugsLocations.Pharma
|
2025-08-09 03:10:00 -06:00
|
|
|
|
2026-01-19 00:46:49 -07:00
|
|
|
Bridge.Callback.Register("md-drugs:client:prescriptionpad", function( data, op)
|
|
|
|
|
local job = Bridge.Framework.GetPlayerJob()
|
2026-01-16 02:57:26 -07:00
|
|
|
if job ~= 'ambulance' then
|
|
|
|
|
Bridge.Notify.SendNotify(Bridge.Language.Locale('pharma.notPharma'), 'error')
|
|
|
|
|
return
|
|
|
|
|
end
|
2026-01-18 01:20:44 -07:00
|
|
|
local input = Bridge.Input.Open(Bridge.Language.Locale('pharma.input.header'), {
|
2026-01-16 02:57:26 -07:00
|
|
|
{type = 'select', title = Bridge.Language.Locale('pharma.input.title1'), options = data},
|
|
|
|
|
{type = 'select', title = Bridge.Language.Locale('pharma.input.title2'), options = op}
|
2025-07-18 01:19:12 -07:00
|
|
|
})
|
2024-12-16 03:34:20 -08:00
|
|
|
if not input[1] then return end
|
2026-01-18 01:20:44 -07:00
|
|
|
if not progressbar(Bridge.Language.Locale('pharma.write'), 4000, 'notepad') then return end
|
2025-08-06 02:25:06 -06:00
|
|
|
return {who = input[1], what = input[2]}
|
2024-01-13 22:23:17 -08:00
|
|
|
end)
|
|
|
|
|
|
2026-01-18 01:20:44 -07:00
|
|
|
Bridge.Callback.Register("md-drugs:client:unbottle", function()
|
|
|
|
|
if not progressbar(Bridge.Language.Locale('pharma.opening'), 4000, 'uncuff') then return end
|
2024-11-23 14:38:23 -08:00
|
|
|
return true
|
2024-01-13 22:23:17 -08:00
|
|
|
end)
|
2025-07-18 01:19:12 -07:00
|
|
|
|
|
|
|
|
|
2025-08-06 02:25:06 -06:00
|
|
|
for k, v in pairs (locations.FillPrescription) do
|
2026-01-18 01:20:44 -07:00
|
|
|
Bridge.Target.AddBoxZone('pharma' ..k , v.loc,vector3(v.l, v.w, 1.0), v.loc.w or 180, {
|
2025-07-18 01:19:12 -07:00
|
|
|
{
|
|
|
|
|
icon = 'fa-solid fa-capsules',
|
2026-01-16 02:57:26 -07:00
|
|
|
label = Bridge.Language.Locale('pharma.targetFill'),
|
2025-07-18 01:19:12 -07:00
|
|
|
action = function()
|
2026-01-18 01:20:44 -07:00
|
|
|
if not progressbar(Bridge.Language.Locale('pharma.fill'), 4000, 'uncuff') then return end
|
2025-07-18 01:19:12 -07:00
|
|
|
TriggerServerEvent("md-drugs:server:fillprescription", k)
|
2025-08-09 03:10:00 -06:00
|
|
|
end,
|
2025-07-18 01:19:12 -07:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|