big update. i prob broke something, let me know in discord

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-09-24 15:07:41 -07:00
1 parent 009b0a4f4a
commit 028c5f771f
42 files changed
+2042 -3056

No files matched your search

+18 -36
View File
@@ -2,64 +2,46 @@ local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('md-drugs:server:startcook', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Itemcheck(Player, 'ephedrine', 1, 'true') and Itemcheck(Player, 'acetone', 1, 'true') then return end
Notifys("Adding Things To The Mix", "success")
RemoveItem('ephedrine', 1)
RemoveItem('acetone', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Started A Meth Batch', 'Meth')
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')
end)
RegisterServerEvent('md-drugs:server:givemethingridients', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local chance = math.random(1,100)
local amount = math.random(1,5)
if chance <= 50 then
if AddItem('ephedrine', amount) then
Notifys(Lang.meth.eph, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
if AddItem(src,'ephedrine', amount) then
Log(GetName(src) .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
end
else
if AddItem('acetone', amount) then
Notifys(Lang.meth.ace, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
if AddItem(src, 'acetone', amount) then
Log(GetName(src) .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
end
end
end)
RegisterServerEvent('md-drugs:server:getmeth', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local amount = math.random(1,5)
if RemoveItem("empty_weed_bag", amount) then
AddItem("methbags", amount)
Notifys("You Made " .. amount .. " Bags Of Meth!", "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged ' .. amount .. 'Of Meth', 'Meth')
else
Notifys(Lang.meth.nobag, "error")
end
local src = source
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
Log(GetName(src) .. ' Bagged 5 Of Meth', 'Meth')
end)
RegisterServerEvent('md-drugs:server:geteph', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.MethEph[num]['loc']) then return end
if AddItem('ephedrine', 1) then
Notifys('Got Ephedrine!', "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth')
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
end)
RegisterServerEvent('md-drugs:server:getace', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.Methace[num]['loc']) then return end
if AddItem('acetone', 1) then
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
Notifys('Got Acetone!', "success")
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
end)