diff --git a/client/heroin.lua b/client/heroin.lua index 454a52e..ffc354f 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -2,6 +2,11 @@ local QBCore = exports['qb-core']:GetCoreObject() local PoppyPlants = {} local herointable = false +local options = { + { event = "md-drugs:client:heatliquidheroin", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.cook, data = heroinlabkit}, + { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}, + } + local function pickher(loc) if not progressbar(Lang.Heroin.pick, 4000, 'uncuff') then return end TriggerServerEvent("heroin:pickupCane", loc) @@ -101,13 +106,9 @@ else local location, head = StartRay() if not location then herointable = false TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end if not progressbar(Lang.Heroin.table, 4000, 'uncuff') then TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end - local heroinlabkit = CreateObject("v_ret_ml_tablea", location.x, location.y, location.z, true, false) + heroinlabkit = CreateObject("v_ret_ml_tablea", location.x, location.y, location.z, true, false) SetEntityHeading(heroinlabkit, head) PlaceObjectOnGroundProperly(heroinlabkit) - local options = { - { event = "md-drugs:client:heatliquidheroin", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.cook, data = heroinlabkit}, - { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}, - } AddMultiModel(heroinlabkit, options, heroinlabkit) end end) @@ -147,10 +148,6 @@ local head = GetEntityHeading(data) local heroinlabkit = CreateObject("v_ret_ml_tablea", location.x, location.y, location.z-1, true, false) SetEntityHeading(heroinlabkit, head) PlaceObjectOnGroundProperly(heroinlabkit) - local options = { - { event = "md-drugs:client:heatliquidheroin", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.cook, data = heroinlabkit}, - { event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end}, - } AddMultiModel(heroinlabkit, options, heroinlabkit) end) diff --git a/client/weed.lua b/client/weed.lua index 121286b..a0d7624 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -140,14 +140,14 @@ AddBoxZoneSingle('makeoil',Config.MakeOil, { if not ItemCheckMulti({'butane', 'grindedweed'}) then return end if not minigame() then local explosion = math.random(1,100) - local loc = GetEntityCoords(PlayerPedId()) - if explosion <= 99 then - AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) - exploded = true - Notify(Lang.Weed.stovehot, "error") - Wait(1000 * 30) - exploded = nil - end + local loc = GetEntityCoords(PlayerPedId()) + if explosion <= 99 then + AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) + exploded = true + Notify(Lang.Weed.stovehot, "error") + Wait(1000 * 30) + exploded = nil + end return end if not progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:makeoil") diff --git a/client/xtc.lua b/client/xtc.lua index 372f272..393a2fe 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -5,8 +5,8 @@ RegisterNetEvent("md-drugs:client:setpress", function(type) if xtcpress then Notify(Lang.xtc.out, 'error') else - local coords, head = StartRay2() - xtcpress = true + local coords, head = StartRay2() + xtcpress = true progressbar('Setting Press On The Ground', 4000, 'uncuff') local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) PlaceObjectOnGroundProperly(press) @@ -16,8 +16,8 @@ RegisterNetEvent("md-drugs:client:setpress", function(type) icon = "fas fa-eye", label = Lang.targets.xtc.make, distance = 2.0, - action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, - onSelect = function() TriggerEvent("md-drugs:client:XTCMenu", type)end, + action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end, + onSelect = function()TriggerEvent("md-drugs:client:XTCMenu", type)end, canInteract = function() if xtcpress then return true end end }, @@ -36,39 +36,15 @@ RegisterNetEvent("md-drugs:client:setpress", function(type) end) RegisterNetEvent("md-drugs:client:XTCMenu", function(type) + local event = "md-drugs:client:MakeXTC" lib.registerContext({ id = 'XTCmenu', title = 'XTC Menu', options = { - { - icon = GetImage('white_xtc'), - title = 'White XTC', - description = '1 X Raw XTC', - event = "md-drugs:client:MakeXTC", - args = { data = type, color = 'white'} - }, - { - icon = GetImage('red_xtc'), - title = 'Red XTC', - description = '1 X Raw XTC and 1 X Loose Coke', - event = "md-drugs:client:MakeXTC", - args = { data = type, color = 'red'} - }, - { - icon = GetImage('orange_xtc'), - title = 'Orange XTC', - description = '1 X Raw XTC and 1 X Heroin Vial', - event = "md-drugs:client:MakeXTC", - args = { data = type, color = 'orange'} - }, - { - icon = GetImage('blue_xtc'), - title = 'Blue XTC', - description = '1 X Raw XTC and 1 X Crack Rock', - event = "md-drugs:client:MakeXTC", - args = { data = type, color = 'blue'} - }, - + {icon = GetImage('white_xtc'), title = 'White XTC', description = '1 X Raw XTC', event = event, args = { data = type, color = 'white'}}, + {icon = GetImage('red_xtc'), title = 'Red XTC', description = '1 X Raw XTC and 1 X Loose Coke', event = event, args = { data = type, color = 'red'}}, + {icon = GetImage('orange_xtc'), title = 'Orange XTC', description = '1 X Raw XTC and 1 X Heroin Vial', event = event, args = { data = type, color = 'orange'}}, + {icon = GetImage('blue_xtc'), title = 'Blue XTC', description = '1 X Raw XTC and 1 X Crack Rock', event = event, args = { data = type, color = 'blue'}}, } }) lib.showContext('XTCmenu') @@ -161,14 +137,14 @@ end) RegisterNetEvent("md-drugs:client:buypress", function() local img = GetImage('singlepress') lib.registerContext({ - id = 'buypresses', - title = 'Purchase Presses', - options = { - { title = Lang.xtc.press.title.single, description = Lang.xtc.des.title.single, icon = img, event = 'md-drugs:client:getsinglepress'}, - { title = Lang.xtc.press.title.dual, description = Lang.xtc.des.title.dual, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'dual'}}, - { title = Lang.xtc.press.title.triple, description = Lang.xtc.des.title.triple, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'triple'}}, - { title = Lang.xtc.press.title.quad, description = Lang.xtc.des.title.quad, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'quad'}} - } + id = 'buypresses', + title = 'Purchase Presses', + options = { + {title = Lang.xtc.press.title.single, description = Lang.xtc.des.title.single, icon = img, event = 'md-drugs:client:getsinglepress'}, + {title = Lang.xtc.press.title.dual, description = Lang.xtc.des.title.dual, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'dual'}}, + {title = Lang.xtc.press.title.triple, description = Lang.xtc.des.title.triple, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'triple'}}, + {title = Lang.xtc.press.title.quad, description = Lang.xtc.des.title.quad, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'quad'}} + } }) lib.showContext('buypresses') end)