jesussssss
This commit is contained in:
1 parent
daa1a4f8a3
commit
3574ecef5b
32 files changed
+1639
-914
No files matched your search
+141
-34
@@ -1,51 +1,90 @@
|
||||
local weedLocs = {
|
||||
WeedTele = { -- where you tele out of weed
|
||||
{inside = vector3(1066.31, -3183.36, -39.16), outside = vector3(244.74, 374.54, 105.74), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
MakeButter = {
|
||||
{loc = vector3(1045.48, -3198.49, -38.22), checks = {}},
|
||||
},
|
||||
MakeOil = {
|
||||
{loc = vector3(1038.90, -3198.66, -38.17), checks = {}},
|
||||
},
|
||||
WeedDry = {
|
||||
{loc = vector3(1043.0, -3191.59, -38.39),},
|
||||
{loc = vector3(1041.0, -3191.59, -38.39),},
|
||||
{loc = vector3(1045.0, -3191.59, -38.39),},
|
||||
{loc = vector3(1039.0, -3191.59, -38.39),},
|
||||
},
|
||||
WeedSalesman = {
|
||||
{loc = vector4(1030.77, -3203.18, -38.2, 262.37), ped = 'a_m_m_farmer_01', gang = ""},
|
||||
},
|
||||
}
|
||||
|
||||
local weedStore = {
|
||||
weedgrinder =25,
|
||||
mdbutter =25,
|
||||
flour =25,
|
||||
chocolate =25,
|
||||
butane =25,
|
||||
butanetorch =2,
|
||||
dabrig =2,
|
||||
mdwoods =2,
|
||||
}
|
||||
|
||||
--------------- events
|
||||
ps.registerCallback('md-drugs:server:GetWeedLocs', function(source)
|
||||
return weedLocs
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:server:getWeedItems', function(source)
|
||||
return weedStore
|
||||
end)
|
||||
RegisterNetEvent('md-drugs:server:buyWeedItem', function(loc, name, amount)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, weedLocs.WeedSalesman[loc].loc, 3.5) then
|
||||
ps.notify(src, ps.lang('Weed.notHere'), "error")
|
||||
return
|
||||
end
|
||||
if not weedStore[name] then
|
||||
ps.notify(src, ps.lang('Weed.notHere'), "error")
|
||||
return
|
||||
end
|
||||
if ps.removeMoney(src, 'cash', weedStore[name] * amount) or ps.removeMoney(src, 'bank', weedStore[name] * amount) then
|
||||
ps.addItem(src, name, amount)
|
||||
else
|
||||
ps.notify(src, ps.lang('Weed.noMoney'), "error")
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:dryoutweed', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if RemoveItem(src,"wetcannabis", 1) then
|
||||
AddItem(src,"drycannabis", 1)
|
||||
--Log(GetName(source) .. ' Dried Weed', 'weed')
|
||||
if ps.removeItem(src,"wetcannabis", 1) then
|
||||
ps.addItem(src,"drycannabis", 1)
|
||||
else
|
||||
ps.notify(src, Lang.Weed.nodry, "error")
|
||||
ps.notify(src, ps.lang('Weed.nodry'), "error")
|
||||
end
|
||||
end)
|
||||
|
||||
local bluntwrap = {'mdreddextro','mdlean'}
|
||||
for k, v in pairs (bluntwrap) do
|
||||
CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:makeBluntWrap', source) end)
|
||||
ps.createUseable(v, function(source, item) TriggerClientEvent('md-drugs:client:makeBluntWrap', source) end)
|
||||
end
|
||||
|
||||
local bluntwraps = {'leanbluntwrap', 'dextrobluntwrap', 'bluntwrap'}
|
||||
|
||||
for k, v in pairs (bluntwraps) do
|
||||
CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:rollBlunt', source) end)
|
||||
ps.createUseable(v, function(source, item) TriggerClientEvent('md-drugs:client:rollBlunt', source) end)
|
||||
end
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:MakeWeedItems', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Player then return end
|
||||
if not GetRecipe(src, data.recipe, data.table, data.item) then return end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makeoil', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Player then return end
|
||||
if not GetRecipe(src, 'weed', 'oil', 'shatter') then return end
|
||||
end)
|
||||
|
||||
|
||||
CUI("dabrig", function(source, item)
|
||||
ps.createUseable("dabrig", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
|
||||
if Player.Functions.GetItemByName("butanetorch") then
|
||||
if RemoveItem(src, "shatter", 1) then
|
||||
if ps.hasItem(src, "butanetorch") then
|
||||
if ps.removeItem(src, "shatter", 1) then
|
||||
TriggerClientEvent("md-drugs:client:dodabs", src)
|
||||
end
|
||||
else
|
||||
@@ -53,25 +92,93 @@ CUI("dabrig", function(source, item)
|
||||
end
|
||||
end)
|
||||
|
||||
CUI("weedgrinder", function(source, item)
|
||||
ps.createUseable("weedgrinder", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local has = Player.Functions.GetItemByName("drycannabis")
|
||||
if not has then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
if not ps.hasItem(src, "drycannabis") then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
AddItem(src, "grindedweed", 1)
|
||||
if ps.removeItem(src, "drycannabis",1 ) then
|
||||
ps.addItem(src, "grindedweed", 1)
|
||||
end
|
||||
end)
|
||||
|
||||
CUI("mdwoods", function(source, item)
|
||||
ps.createUseable("mdwoods", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "mdwoods",1 ) then
|
||||
AddItem(src, "bluntwrap", 5)
|
||||
AddItem(src, "tobacco", 5)
|
||||
if ps.removeItem(src, "mdwoods",1 ) then
|
||||
ps.addItem(src, "bluntwrap", 5)
|
||||
ps.addItem(src, "tobacco", 5)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
exports['ps_lib']:registerCrafter({
|
||||
loc = weedLocs.MakeButter,
|
||||
recipes = {
|
||||
cannabutter = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
mdbutter = 1,
|
||||
grindedweed = 1
|
||||
}
|
||||
},
|
||||
specialbrownie = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
cannabutter = 1,
|
||||
flour = 1,
|
||||
chocolate = 1
|
||||
}
|
||||
},
|
||||
specialcookie = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
cannabutter = 1,
|
||||
flour = 1
|
||||
}
|
||||
},
|
||||
specialchocolate = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
cannabutter = 1,
|
||||
chocolate = 1
|
||||
}
|
||||
},
|
||||
specialmuffin = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
cannabutter = 1,
|
||||
flour = 1
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
exports['ps_lib']:registerCrafter({
|
||||
loc = weedLocs.MakeOil,
|
||||
recipes = {
|
||||
shatter = {
|
||||
amount = 1,
|
||||
time = 4000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
butane = 1,
|
||||
grindedweed = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user