Files
md-drugs/server/meth.lua
T

47 lines
1.5 KiB
Lua
Raw Normal View History

2023-12-07 15:45:48 -08:00
local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('md-drugs:server:startcook', function()
local src = source
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
Notifys(src, "Adding Things To The Mix", "success")
Log(GetName(source) .. ' Started A Meth Batch', 'Meth')
2023-12-07 15:45:48 -08:00
end)
RegisterServerEvent('md-drugs:server:givemethingridients', function()
local src = source
2023-12-07 15:45:48 -08:00
local chance = math.random(1,100)
local amount = math.random(1,5)
if chance <= 50 then
if AddItem(src,'ephedrine', amount) then
Log(GetName(src) .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
2023-12-07 15:45:48 -08:00
end
else
if AddItem(src, 'acetone', amount) then
Log(GetName(src) .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
2023-12-07 15:45:48 -08:00
end
end
end)
RegisterServerEvent('md-drugs:server:getmeth', function()
local src = source
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
Log(GetName(src) .. ' Bagged 5 Of Meth', 'Meth')
2024-05-02 18:34:49 -07:00
end)
RegisterServerEvent('md-drugs:server:geteph', function(num)
local src = source
if CheckDist(src, Config.MethEph[num]['loc']) then return end
if AddItem(src, 'ephedrine', 1) then
Notifys(src, 'Got Ephedrine!', "success")
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth')
end
2024-05-02 18:34:49 -07:00
end)
RegisterServerEvent('md-drugs:server:getace', function(num)
local src = source
if CheckDist(src, Config.Methace[num]['loc']) then return end
if AddItem(src, 'acetone', 1) then
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
Notifys(src, 'Got Acetone!', "success")
end
2023-12-07 15:45:48 -08:00
end)