update
This commit is contained in:
1 parent
c7479b44ff
commit
3db581ac1e
6 files changed
+37
-33
No files matched your search
@@ -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
@@ -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
-4
@@ -61,13 +61,11 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
|
||||
elseif mor then
|
||||
RemoveItem(src,'morphine_prescription', 1 )
|
||||
AddItem(src,'morphinebottle', 1)
|
||||
Notifys(src,Lang.Pharma.pills, "success")
|
||||
|
||||
Notifys(src,Lang.Pharma.pills, "success")
|
||||
elseif xan then
|
||||
RemoveItem(src,'xanax_prescription', 1 )
|
||||
AddItem(src,'xanaxbottle', 1)
|
||||
Notifys(src,Lang.Pharma.pills, "success")
|
||||
|
||||
Notifys(src,Lang.Pharma.pills, "success")
|
||||
else
|
||||
Notifys(src,Lang.Pharma.no, "error")
|
||||
end
|
||||
|
||||
+1
-4
@@ -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
|
||||
|
||||
+16
-18
@@ -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
|
||||
@@ -91,24 +89,24 @@ end
|
||||
end)
|
||||
|
||||
QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item)
|
||||
local src = source
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
AddItem(src, "grindedweed", 1)
|
||||
TriggerClientEvent("md-drugs:client:grind", src)
|
||||
else
|
||||
Notifys(src,'You Need Dried Weed', 'error')
|
||||
end
|
||||
local src = source
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
AddItem(src, "grindedweed", 1)
|
||||
TriggerClientEvent("md-drugs:client:grind", src)
|
||||
else
|
||||
Notifys(src,'You Need Dried Weed', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
QBCore.Functions.CreateUseableItem("mdwoods", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
TriggerClientEvent("md-drugs:client:rollanim", src)
|
||||
Wait(4000)
|
||||
if RemoveItem(src, "mdwoods",1 ) then
|
||||
AddItem(src, "bluntwrap", 5)
|
||||
AddItem(src, "tobacco", 5)
|
||||
end
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
TriggerClientEvent("md-drugs:client:rollanim", src)
|
||||
Wait(4000)
|
||||
if RemoveItem(src, "mdwoods",1 ) then
|
||||
AddItem(src, "bluntwrap", 5)
|
||||
AddItem(src, "tobacco", 5)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user