big update. i prob broke something, let me know in discord
This commit is contained in:
1 parent
009b0a4f4a
commit
028c5f771f
42 files changed
+2042
-3056
No files matched your search
+41
-8
@@ -5,14 +5,7 @@ CreateThread(function()
|
||||
lib.requestModel(current, Config.RequestModelTime)
|
||||
local SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, Config.SyrupVendor.w, false, false)
|
||||
Freeze(SyrupLocation, true, Config.SyrupVendor.w)
|
||||
local options = {
|
||||
{ type = "client", label = "Get Task", icon = "fas fa-eye", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0},
|
||||
}
|
||||
if Config.oxtarget then
|
||||
exports.ox_target:addLocalEntity(SyrupLocation, options)
|
||||
else
|
||||
exports['qb-target']:AddTargetEntity(SyrupLocation, { options = options, distance = 2.0})
|
||||
end
|
||||
AddSingleModel(SyrupLocation, { type = "client", label = "Get Task", icon = "fas fa-eye", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil )
|
||||
end)
|
||||
|
||||
|
||||
@@ -20,3 +13,43 @@ RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function()
|
||||
Notify(Lang.Lean.marked, "success")
|
||||
SpawnCarPedChase()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('md-drugs:client:leancraft', function()
|
||||
local store = {}
|
||||
local label = {}
|
||||
local items = lib.callback.await('md-drugs:server:GetRecipe', false,'lean', 'cups')
|
||||
for k, v in pairs (items) do
|
||||
label = {}
|
||||
local item = ''
|
||||
for m, d in pairs (items[k].take) do
|
||||
table.insert(label, GetLabel(m) .. ' X ' .. d)
|
||||
end
|
||||
for m,d in pairs (items[k].give) do
|
||||
item = m
|
||||
end
|
||||
store[#store + 1] = {
|
||||
icon = GetImage(item),
|
||||
description = table.concat(label, ", "),
|
||||
title = GetLabel(item),
|
||||
event = 'md-drugs:client:stirlean',
|
||||
args = {
|
||||
item = item,
|
||||
recipe = 'weed',
|
||||
num = k,
|
||||
label = 'Cooking Up ' .. GetLabel(item),
|
||||
table = 'edibles'
|
||||
|
||||
}
|
||||
}
|
||||
lib.registerContext({id = 'leanCraft',title = "Make Lean", options = store})
|
||||
end
|
||||
lib.showContext('leanCraft')
|
||||
end)
|
||||
local busy = false
|
||||
RegisterNetEvent('md-drugs:client:stirlean', function(data)
|
||||
if busy then return end
|
||||
busy = true
|
||||
if not progressbar(data.label, 4000, 'uncuff') then busy = false return end
|
||||
TriggerServerEvent('md-drugs:server:finishcup', data)
|
||||
busy = false
|
||||
end)
|
||||
Reference in new issue
Block a user