Files
md-drugs/client/meth.lua
T

126 lines
4.8 KiB
Lua
Raw Normal View History

2024-01-13 22:23:17 -08:00
local amonia = nil
local tray = nil
local heated = nil
2024-05-02 18:34:14 -07:00
local active = nil
2024-05-02 18:34:14 -07:00
local function startcook()
if not ItemCheck('empty_weed_bag') then return end
if not ItemCheck('acetone') then return end
if not ItemCheck('ephedrine') then return end
2024-05-02 18:34:14 -07:00
if amonia == nil then
active = true
TriggerServerEvent("md-drugs:server:startcook")
MethCooking()
amonia = true
else
Notify(Lang.meth.inside, "error")
end
end
2024-01-13 22:23:17 -08:00
2024-05-02 18:34:14 -07:00
local function dials()
if amonia == true then
2024-10-23 17:44:46 -07:00
if not minigame() then
2024-11-25 12:27:43 -08:00
AddExplosion(1005.773, -3200.402, -38.524, 49, 10, true, false, true)
2024-05-02 18:34:14 -07:00
ClearPedTasks(PlayerPedId())
amonia = nil
active = nil
return end
Notify(Lang.meth.increaseheat, "success")
ClearPedTasks(PlayerPedId())
2024-05-08 17:32:57 -07:00
heated = true
2024-05-02 18:34:14 -07:00
else
end
end
local function smash()
if tray then
tray = false
DeleteObject(trays)
2024-11-25 12:27:43 -08:00
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", vector3(1012.85, -3194.29, -39.2), true, true, true)
Freeze(bucket, true, 90.0)
2024-05-02 18:34:14 -07:00
SmashMeth()
Wait(100)
2024-10-23 17:44:46 -07:00
AddSingleModel(bucket,
2024-10-28 14:35:47 -07:00
{name = 'bucket',icon = "fa-solid fa-sack-xmark",label = Lang.targets.meth.bag, canInteract = function() if active == nil then return false end end,
2024-10-23 17:44:46 -07:00
action = function()
2024-10-28 14:11:49 -07:00
active = nil
2024-10-23 17:44:46 -07:00
DeleteObject(bucket)
2024-10-28 14:11:49 -07:00
amonia = nil
heated = nil
tray = nil
BagMeth()
2024-10-23 17:44:46 -07:00
TriggerServerEvent('md-drugs:server:getmeth')
end,}, bucket)
2024-05-02 18:34:14 -07:00
end
end
local function trayscarry()
if amonia then
local pos = GetEntityCoords(PlayerPedId(), true)
RequestAnimDict('anim@heists@box_carry@')
while (not HasAnimDictLoaded('anim@heists@box_carry@')) do
Wait(7)
end
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false,
false)
RequestModel("bkr_prop_meth_tray_02a")
while not HasModelLoaded("bkr_prop_meth_tray_02a") do
Wait(0)
end
trays = CreateObject("bkr_prop_meth_tray_02a", pos.x, pos.y, pos.z, true, true, true)
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01, -0.2,
-0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
tray = true
end
end
2024-01-13 22:23:17 -08:00
CreateThread(function()
BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
BikerMethLab.Style.Set(BikerMethLab.Style.upgrade)
BikerMethLab.Security.Set(BikerMethLab.Security.upgrade)
BikerMethLab.Details.Enable(BikerMethLab.Details.production, true)
RefreshInterior(BikerMethLab.interiorId)
end)
CreateThread(function()
2025-07-01 03:09:46 -07:00
local config = ps.callback('md-drugs:server:getLocs', false)
2024-11-11 20:22:48 -08:00
AddBoxZoneSingle("methTeleOut",config.singleSpot.MethTeleIn, {name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleOut) end} )
AddBoxZoneSingle("methtelein",config.singleSpot.MethTeleOut, {name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleIn) end} )
local options = {
{ name = 'methcook', icon = "fa-solid fa-temperature-high", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end,
2024-09-28 18:17:25 -07:00
canInteract = function()
if amonia == nil and active == nil then
return true
end
end,
2024-05-02 18:34:14 -07:00
},
{ name = 'grabtray', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.tray, distance = 2.5, action = function() trayscarry() end,
canInteract = function()
if heated and amonia and tray == nil then return true end
end,
2024-05-02 18:34:14 -07:00
},
}
2024-09-28 18:17:25 -07:00
AddBoxZoneMultiOptions("cookmeth",vector3(1005.72, -3200.33, -38.52), options )
2024-11-25 01:21:53 -08:00
AddBoxZoneSingle('boxmeth', vector3(1012.15, -3194.04, -39.20), {name = 'boxmeth',icon = "fa-solid fa-weight-scale",label = Lang.targets.meth.box,action = function() smash()end,
canInteract = function()
if tray then return true end
end})
2024-11-25 01:21:53 -08:00
AddBoxZoneSingle('adjustdials',vector3(1007.89, -3201.17, -38.99),{ name = 'adjustdials', icon = "fa-solid fa-temperature-three-quarters", label = Lang.targets.meth.adjust,
2024-10-23 17:44:46 -07:00
distance = 5, action = function() dials() end,
canInteract = function()
if amonia and heated == nil then return true end end
2024-05-02 18:34:14 -07:00
})
if Config.MethHeist == false then
2024-11-25 01:21:53 -08:00
AddBoxZoneMulti('methep', config.MethEph, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'})
AddBoxZoneMulti('methace', config.Methace, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'})
2024-05-02 18:34:14 -07:00
end
2024-01-13 22:23:17 -08:00
end)
2024-05-02 18:34:14 -07:00
RegisterNetEvent("md-drugs:client:stealeph", function(data)
if not progressbar('Stealing Ephedrine', 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:geteph", data.data)
end)
RegisterNetEvent("md-drugs:client:stealace", function(data)
if not progressbar('Stealing Acetone', 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getace", data.data)
end)