This commit is contained in:
Mustache Dom committed 2024-11-05 00:46:12 -08:00
1 parent c7479b44ff
commit 3db581ac1e
6 files changed
+20 -16

No files matched your search

+5 -2
View File
@@ -286,7 +286,10 @@ function AddRep(source, type, amount)
return true
end
RegisterCommand('addCornerSellingTOREP', function()
lib.addCommand('addCornerSellingTOREP', {
help = 'RUN THIS ONCE AND DELETE',
restricted = 'group.admin'
}, function(source, args, raw)
local sql = MySQL.query.await('SELECT * FROM drugrep', {})
for k, v in pairs (sql) do
local new = {}
@@ -307,7 +310,7 @@ RegisterCommand('addCornerSellingTOREP', function()
local news = json.encode(new)
MySQL.query.await('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {news, v.cid})
end
end, false)
end)
function sortTab(tbl, type)
table.sort(tbl, function(a, b)
+13 -3
View File
@@ -128,8 +128,10 @@ end)
RegisterServerEvent('md-drugs:server:maketabpaper', function()
local src = source
local Player = getPlayer(src)
if not Itemcheck(src,'tab_paper', 1) then return end
local count = 0
local items, recieve = nil, nil
local vialdata = {
{vial = 'lsd_one_vial', sheet = 'smileyfacesheet', log = 'Made A Smiley Face Sheet'},
{vial = 'lsd_vial_two', sheet = 'wildcherrysheet', log = 'Made A Wild Cherry Sheet'},
@@ -140,13 +142,21 @@ RegisterServerEvent('md-drugs:server:maketabpaper', function()
}
sortTab(vialdata, 'vial')
for k, v in pairs (vialdata) do
if count >= 1 then return end
if RemoveItem(src, v.vial, 1) and RemoveItem(src, 'tab_paper', 1) then
AddItem(src, v.sheet, 1)
if count >= 1 then break end
local check = Player.Functions.GetItemByName(v.vial)
if check and check.amount >= 1 then
items = v.vial
recieve = v.sheet
Log(GetName(src) ..' ' .. v.log, 'lsd')
count = count + 1
end
end
if count >= 1 then
if RemoveItem(src, items, 1) and RemoveItem(src, 'tab_paper', 1) then
AddItem(src, recieve, 1)
end
end
end)
local sheets = {
-2
View File
@@ -62,12 +62,10 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
RemoveItem(src,'morphine_prescription', 1 )
AddItem(src,'morphinebottle', 1)
Notifys(src,Lang.Pharma.pills, "success")
elseif xan then
RemoveItem(src,'xanax_prescription', 1 )
AddItem(src,'xanaxbottle', 1)
Notifys(src,Lang.Pharma.pills, "success")
else
Notifys(src,Lang.Pharma.no, "error")
end
+1 -4
View File
@@ -20,10 +20,7 @@ function shroomsCooldown(loc)
end)
end
RegisterNetEvent("shrooms:pickupCane")
AddEventHandler("shrooms:pickupCane", function(loc)
local chance = math.random(1,10)
RegisterNetEvent("shrooms:pickupCane", function(loc)
if CheckDist(source, Config.shrooms[loc].location) then return end
if not Config.shrooms[loc].taken then
Config.shrooms[loc].taken = true
+1 -3
View File
@@ -20,8 +20,7 @@ function WeedCooldown(loc)
end)
end
RegisterNetEvent("weed:pickupCane")
AddEventHandler("weed:pickupCane", function(loc)
RegisterNetEvent("weed:pickupCane", function(loc)
local src = source
if not Config.WeedPlant[loc].taken then
Config.WeedPlant[loc].taken = true
@@ -30,7 +29,6 @@ AddEventHandler("weed:pickupCane", function(loc)
WeedCooldown(loc)
AddItem(src, 'wetcannabis', 1)
Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, Config.WeedPlant[loc].location) .. ' vectors', 'weed')
end
end)
--------------- events
-2
View File
@@ -52,9 +52,7 @@ end)
QBCore.Functions.CreateUseableItem("lsdburner", function(source, item)
local src = source
local Player = getPlayer(source)
TriggerClientEvent("md-drugs:client:GetLocation", src, 'lsd', "Bring Me All The lsd You Have")
end)
RegisterServerEvent('md-drugs:server:wholesalelsd', function()