2024-10-28 14:11:49 -07:00
|
|
|
local exploded, drying = false, false
|
2025-08-06 02:25:06 -06:00
|
|
|
local locations = ps.callback('md-drugs:server:GetWeedLocs')
|
|
|
|
|
for k, v in pairs (locations.WeedDry) do
|
|
|
|
|
ps.boxTarget('weed_dry'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
|
|
|
|
{
|
|
|
|
|
icon = 'fa-solid fa-cannabis',
|
2025-08-09 03:10:00 -06:00
|
|
|
label = ps.lang('weed.targetDry'),
|
2025-08-06 02:25:06 -06:00
|
|
|
action = function()
|
|
|
|
|
if not ps.hasItem('wetcannabis', 1) then
|
2025-09-12 01:37:10 -06:00
|
|
|
ps.notify(ps.lang('weed.noDry'), "error")
|
2025-08-06 02:25:06 -06:00
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if drying then return end
|
2024-09-24 15:07:41 -07:00
|
|
|
local loc = GetEntityCoords(PlayerPedId())
|
|
|
|
|
local weedplant = CreateObject("bkr_prop_weed_drying_01a", loc.x, loc.y+.2, loc.z, true, false)
|
|
|
|
|
drying = true
|
|
|
|
|
FreezeEntityPosition(weedplant, true)
|
2025-08-09 03:10:00 -06:00
|
|
|
ps.notify(ps.lang('weed.wait'), "success")
|
2024-09-24 15:07:41 -07:00
|
|
|
Wait(math.random(1000,5000))
|
2025-08-09 03:10:00 -06:00
|
|
|
ps.notify(ps.lang('weed.take'), "success")
|
2025-08-06 02:25:06 -06:00
|
|
|
ps.entityTarget(weedplant, {
|
2025-09-12 01:37:10 -06:00
|
|
|
{
|
|
|
|
|
icon = "fa-solid fa-cannabis",
|
|
|
|
|
label = ps.lang('weed.targetDryed'),
|
|
|
|
|
action = function()
|
|
|
|
|
DeleteEntity(weedplant)
|
|
|
|
|
drying = false
|
|
|
|
|
TriggerServerEvent('md-drugs:server:dryoutweed')
|
|
|
|
|
end,
|
|
|
|
|
}
|
2025-08-06 02:25:06 -06:00
|
|
|
})
|
2025-09-12 01:37:10 -06:00
|
|
|
end,
|
|
|
|
|
canInteract = function()
|
|
|
|
|
if drying then return false end
|
|
|
|
|
return true
|
2024-09-24 15:07:41 -07:00
|
|
|
end
|
2025-08-06 02:25:06 -06:00
|
|
|
}
|
2024-09-24 15:07:41 -07:00
|
|
|
})
|
2025-08-06 02:25:06 -06:00
|
|
|
end
|
2024-01-13 22:23:17 -08:00
|
|
|
|
2025-08-06 02:25:06 -06:00
|
|
|
for k, v in pairs (locations.WeedTele) do
|
|
|
|
|
ps.boxTarget('weed_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
|
|
|
|
{
|
|
|
|
|
icon = 'fa-solid fa-door-open',
|
2025-08-09 03:10:00 -06:00
|
|
|
label = ps.lang('weed.teleportOut'),
|
2025-08-06 02:25:06 -06:00
|
|
|
action = function()
|
|
|
|
|
SetEntityCoords(PlayerPedId(), v.outside)
|
|
|
|
|
end
|
|
|
|
|
}
|
2024-11-24 01:25:09 -08:00
|
|
|
})
|
2025-08-06 02:25:06 -06:00
|
|
|
ps.boxTarget('weed_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
|
|
|
|
{
|
|
|
|
|
icon = 'fa-solid fa-door-closed',
|
2025-08-09 03:10:00 -06:00
|
|
|
label = ps.lang('weed.teleportIn'),
|
2025-08-06 02:25:06 -06:00
|
|
|
action = function()
|
|
|
|
|
SetEntityCoords(PlayerPedId(), v.inside)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|
2024-01-13 22:23:17 -08:00
|
|
|
|
|
|
|
|
CreateThread(function()
|
|
|
|
|
BikerWeedFarm = exports['bob74_ipl']:GetBikerWeedFarmObject()
|
|
|
|
|
BikerWeedFarm.Style.Set(BikerWeedFarm.Style.upgrade)
|
|
|
|
|
BikerWeedFarm.Security.Set(BikerWeedFarm.Security.upgrade)
|
|
|
|
|
BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.chairs, true)
|
|
|
|
|
BikerWeedFarm.Details.Enable({BikerWeedFarm.Details.production, BikerWeedFarm.Details.chairs, BikerWeedFarm.Details.drying}, true)
|
2024-10-24 12:56:34 -07:00
|
|
|
BikerWeedFarm.Plant1.Clear(false) BikerWeedFarm.Plant2.Clear(false) BikerWeedFarm.Plant3.Clear(false)
|
|
|
|
|
BikerWeedFarm.Plant4.Clear(false) BikerWeedFarm.Plant5.Clear(false) BikerWeedFarm.Plant6.Clear(false)
|
|
|
|
|
BikerWeedFarm.Plant7.Clear(false) BikerWeedFarm.Plant8.Clear(false) BikerWeedFarm.Plant9.Clear(false)
|
2024-01-13 22:23:17 -08:00
|
|
|
RefreshInterior(BikerWeedFarm.interiorId)
|
|
|
|
|
end)
|
|
|
|
|
|
2025-09-05 21:28:04 -07:00
|
|
|
local function AlienEffect()
|
|
|
|
|
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
|
|
|
|
Wait(math.random(5000, 8000))
|
|
|
|
|
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
|
|
|
Wait(math.random(5000, 8000))
|
|
|
|
|
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
|
|
|
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
|
|
|
StopScreenEffect("DrugsMichaelAliensFight")
|
|
|
|
|
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
|
|
|
end
|
|
|
|
|
|
2024-01-13 22:23:17 -08:00
|
|
|
RegisterNetEvent("md-drugs:client:dodabs", function()
|
2025-08-09 03:10:00 -06:00
|
|
|
if not ps.progressbar(ps.lang('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
|
2024-01-13 22:23:17 -08:00
|
|
|
end)
|
|
|
|
|
|
2024-10-24 12:56:34 -07:00
|
|
|
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
|
|
|
|
|
local options = {}
|
2025-09-12 15:24:38 -07:00
|
|
|
local items = ps.callback('md-drugs:server:GetWeedRecipe', tableName)
|
2024-10-24 12:56:34 -07:00
|
|
|
for k, v in pairs(items) do
|
|
|
|
|
local label = {}
|
|
|
|
|
local item = ''
|
2025-08-06 02:25:06 -06:00
|
|
|
for m, d in pairs(v.take) do table.insert(label, ps.getLabel(m) .. ' X ' .. d) end
|
2024-10-24 12:56:34 -07:00
|
|
|
for m, d in pairs(v.give) do item = m end
|
|
|
|
|
options[#options + 1] = {
|
2025-08-06 02:25:06 -06:00
|
|
|
icon = ps.getImage(item),
|
2024-10-24 12:56:34 -07:00
|
|
|
description = table.concat(label, ", "),
|
2025-08-06 02:25:06 -06:00
|
|
|
title = ps.getLabel(item),
|
|
|
|
|
action = function()
|
|
|
|
|
if not minigame() then return end
|
|
|
|
|
if not ps.progressbar(eventLabelPrefix .. ps.getLabel(item), 4000, 'uncuff') then return end
|
|
|
|
|
TriggerServerEvent('md-drugs:server:MakeWeedItems', {item = item, recipe = 'weed', num = k, table = tableName})
|
|
|
|
|
end
|
2024-10-24 12:56:34 -07:00
|
|
|
}
|
|
|
|
|
end
|
2025-09-05 21:28:04 -07:00
|
|
|
ps.sorter(options, 'title')
|
2025-08-06 02:25:06 -06:00
|
|
|
ps.menu(contextTitle, contextTitle, options)
|
2024-09-24 15:07:41 -07:00
|
|
|
end
|
2024-10-24 12:56:34 -07:00
|
|
|
|
2025-08-06 02:25:06 -06:00
|
|
|
RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data)
|
2025-08-09 03:10:00 -06:00
|
|
|
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", ps.lang('weed.bluntWrap'), 'bluntwrap')
|
2024-09-24 15:07:41 -07:00
|
|
|
end)
|
|
|
|
|
|
2025-08-06 02:25:06 -06:00
|
|
|
RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
|
2025-08-09 03:10:00 -06:00
|
|
|
createBluntOptions('mddrugsblunts', "Roll Blunts", ps.lang('weed.blunts'), 'blunts')
|
2024-09-24 15:07:41 -07:00
|
|
|
end)
|
|
|
|
|
|
2025-08-06 02:25:06 -06:00
|
|
|
for k, v in pairs (locations.WeedSalesman) do
|
|
|
|
|
ps.requestModel(v.ped)
|
|
|
|
|
local ped = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z - 1.0, v.loc.w, false, true)
|
|
|
|
|
FreezeEntityPosition(ped, true)
|
|
|
|
|
SetEntityInvincible(ped, true)
|
|
|
|
|
SetBlockingOfNonTemporaryEvents(ped, true)
|
|
|
|
|
ps.entityTarget(ped, {
|
|
|
|
|
{
|
|
|
|
|
icon = "fa-solid fa-cannabis",
|
2025-08-09 03:10:00 -06:00
|
|
|
label = ps.lang('weed.targetSales'),
|
2025-08-06 02:25:06 -06:00
|
|
|
action = function()
|
|
|
|
|
local itemList = ps.callback('md-drugs:server:getWeedItems')
|
|
|
|
|
local options = {}
|
|
|
|
|
for m, d in pairs (itemList) do
|
|
|
|
|
options[#options + 1] = {
|
|
|
|
|
icon = ps.getImage(m),
|
|
|
|
|
title = ps.getLabel(m),
|
|
|
|
|
description = '$' .. d,
|
|
|
|
|
action = function()
|
|
|
|
|
local input = ps.input('Amount To Buy',{
|
|
|
|
|
{type = 'number', title = 'How Many To Buy', min = 1, max = 1000}
|
|
|
|
|
})
|
|
|
|
|
if not input and input[1] then return end
|
2025-08-09 03:10:00 -06:00
|
|
|
if not ps.progressbar(ps.lang('weed.buying', ps.getLabel(m)), 2000, 'uncuff') then return end
|
2025-08-06 02:25:06 -06:00
|
|
|
TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1])
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
ps.menu('Weed Shop', 'Weed Shop', options)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
end
|
2025-10-09 02:53:40 -06:00
|
|
|
local props = {}
|
2024-09-24 15:07:41 -07:00
|
|
|
|
2025-10-09 02:53:40 -06:00
|
|
|
for locationKey, locationData in pairs (locations.MakeButter) do
|
|
|
|
|
if locationData.prop then
|
|
|
|
|
ps.requestModel(locationData.prop)
|
|
|
|
|
props[#props+1] = CreateObject(locationData.prop, locationData.loc.x, locationData.loc.y, locationData.loc.z - 1.0, false, false, false)
|
|
|
|
|
FreezeEntityPosition(props[#props], true)
|
|
|
|
|
SetEntityHeading(props[#props], locationData.loc.w)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for locationKey, locationData in pairs (locations.MakeOil) do
|
|
|
|
|
if locationData.prop then
|
|
|
|
|
ps.requestModel(locationData.prop)
|
|
|
|
|
props[#props+1] = CreateObject(locationData.prop, locationData.loc.x, locationData.loc.y, locationData.loc.z - 1.0, false, false, false)
|
|
|
|
|
FreezeEntityPosition(props[#props], true)
|
|
|
|
|
SetEntityHeading(props[#props], locationData.loc.w)
|
|
|
|
|
end
|
|
|
|
|
end
|