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
|
return true
|
||||||
end
|
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', {})
|
local sql = MySQL.query.await('SELECT * FROM drugrep', {})
|
||||||
for k, v in pairs (sql) do
|
for k, v in pairs (sql) do
|
||||||
local new = {}
|
local new = {}
|
||||||
@@ -307,7 +310,7 @@ RegisterCommand('addCornerSellingTOREP', function()
|
|||||||
local news = json.encode(new)
|
local news = json.encode(new)
|
||||||
MySQL.query.await('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {news, v.cid})
|
MySQL.query.await('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {news, v.cid})
|
||||||
end
|
end
|
||||||
end, false)
|
end)
|
||||||
|
|
||||||
function sortTab(tbl, type)
|
function sortTab(tbl, type)
|
||||||
table.sort(tbl, function(a, b)
|
table.sort(tbl, function(a, b)
|
||||||
|
|||||||
+13
-3
@@ -128,8 +128,10 @@ end)
|
|||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:maketabpaper', function()
|
RegisterServerEvent('md-drugs:server:maketabpaper', function()
|
||||||
local src = source
|
local src = source
|
||||||
|
local Player = getPlayer(src)
|
||||||
if not Itemcheck(src,'tab_paper', 1) then return end
|
if not Itemcheck(src,'tab_paper', 1) then return end
|
||||||
local count = 0
|
local count = 0
|
||||||
|
local items, recieve = nil, nil
|
||||||
local vialdata = {
|
local vialdata = {
|
||||||
{vial = 'lsd_one_vial', sheet = 'smileyfacesheet', log = 'Made A Smiley Face Sheet'},
|
{vial = 'lsd_one_vial', sheet = 'smileyfacesheet', log = 'Made A Smiley Face Sheet'},
|
||||||
{vial = 'lsd_vial_two', sheet = 'wildcherrysheet', log = 'Made A Wild Cherry 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')
|
sortTab(vialdata, 'vial')
|
||||||
for k, v in pairs (vialdata) do
|
for k, v in pairs (vialdata) do
|
||||||
if count >= 1 then return end
|
if count >= 1 then break end
|
||||||
if RemoveItem(src, v.vial, 1) and RemoveItem(src, 'tab_paper', 1) then
|
local check = Player.Functions.GetItemByName(v.vial)
|
||||||
AddItem(src, v.sheet, 1)
|
|
||||||
|
if check and check.amount >= 1 then
|
||||||
|
items = v.vial
|
||||||
|
recieve = v.sheet
|
||||||
Log(GetName(src) ..' ' .. v.log, 'lsd')
|
Log(GetName(src) ..' ' .. v.log, 'lsd')
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
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)
|
end)
|
||||||
|
|
||||||
local sheets = {
|
local sheets = {
|
||||||
|
|||||||
+2
-4
@@ -61,13 +61,11 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
|
|||||||
elseif mor then
|
elseif mor then
|
||||||
RemoveItem(src,'morphine_prescription', 1 )
|
RemoveItem(src,'morphine_prescription', 1 )
|
||||||
AddItem(src,'morphinebottle', 1)
|
AddItem(src,'morphinebottle', 1)
|
||||||
Notifys(src,Lang.Pharma.pills, "success")
|
Notifys(src,Lang.Pharma.pills, "success")
|
||||||
|
|
||||||
elseif xan then
|
elseif xan then
|
||||||
RemoveItem(src,'xanax_prescription', 1 )
|
RemoveItem(src,'xanax_prescription', 1 )
|
||||||
AddItem(src,'xanaxbottle', 1)
|
AddItem(src,'xanaxbottle', 1)
|
||||||
Notifys(src,Lang.Pharma.pills, "success")
|
Notifys(src,Lang.Pharma.pills, "success")
|
||||||
|
|
||||||
else
|
else
|
||||||
Notifys(src,Lang.Pharma.no, "error")
|
Notifys(src,Lang.Pharma.no, "error")
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-4
@@ -20,10 +20,7 @@ function shroomsCooldown(loc)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent("shrooms:pickupCane", function(loc)
|
||||||
RegisterNetEvent("shrooms:pickupCane")
|
|
||||||
AddEventHandler("shrooms:pickupCane", function(loc)
|
|
||||||
local chance = math.random(1,10)
|
|
||||||
if CheckDist(source, Config.shrooms[loc].location) then return end
|
if CheckDist(source, Config.shrooms[loc].location) then return end
|
||||||
if not Config.shrooms[loc].taken then
|
if not Config.shrooms[loc].taken then
|
||||||
Config.shrooms[loc].taken = true
|
Config.shrooms[loc].taken = true
|
||||||
|
|||||||
+16
-18
@@ -20,8 +20,7 @@ function WeedCooldown(loc)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent("weed:pickupCane")
|
RegisterNetEvent("weed:pickupCane", function(loc)
|
||||||
AddEventHandler("weed:pickupCane", function(loc)
|
|
||||||
local src = source
|
local src = source
|
||||||
if not Config.WeedPlant[loc].taken then
|
if not Config.WeedPlant[loc].taken then
|
||||||
Config.WeedPlant[loc].taken = true
|
Config.WeedPlant[loc].taken = true
|
||||||
@@ -30,7 +29,6 @@ AddEventHandler("weed:pickupCane", function(loc)
|
|||||||
WeedCooldown(loc)
|
WeedCooldown(loc)
|
||||||
AddItem(src, 'wetcannabis', 1)
|
AddItem(src, 'wetcannabis', 1)
|
||||||
Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, Config.WeedPlant[loc].location) .. ' vectors', 'weed')
|
Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, Config.WeedPlant[loc].location) .. ' vectors', 'weed')
|
||||||
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
--------------- events
|
--------------- events
|
||||||
@@ -91,24 +89,24 @@ end
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item)
|
QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item)
|
||||||
local src = source
|
local src = source
|
||||||
if RemoveItem(src, "drycannabis",1 ) then
|
if RemoveItem(src, "drycannabis",1 ) then
|
||||||
AddItem(src, "grindedweed", 1)
|
AddItem(src, "grindedweed", 1)
|
||||||
TriggerClientEvent("md-drugs:client:grind", src)
|
TriggerClientEvent("md-drugs:client:grind", src)
|
||||||
else
|
else
|
||||||
Notifys(src,'You Need Dried Weed', 'error')
|
Notifys(src,'You Need Dried Weed', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
QBCore.Functions.CreateUseableItem("mdwoods", function(source, item)
|
QBCore.Functions.CreateUseableItem("mdwoods", function(source, item)
|
||||||
local src = source
|
local src = source
|
||||||
local Player = getPlayer(src)
|
local Player = getPlayer(src)
|
||||||
TriggerClientEvent("md-drugs:client:rollanim", src)
|
TriggerClientEvent("md-drugs:client:rollanim", src)
|
||||||
Wait(4000)
|
Wait(4000)
|
||||||
if RemoveItem(src, "mdwoods",1 ) then
|
if RemoveItem(src, "mdwoods",1 ) then
|
||||||
AddItem(src, "bluntwrap", 5)
|
AddItem(src, "bluntwrap", 5)
|
||||||
AddItem(src, "tobacco", 5)
|
AddItem(src, "tobacco", 5)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
@@ -52,9 +52,7 @@ end)
|
|||||||
QBCore.Functions.CreateUseableItem("lsdburner", function(source, item)
|
QBCore.Functions.CreateUseableItem("lsdburner", function(source, item)
|
||||||
local src = source
|
local src = source
|
||||||
local Player = getPlayer(source)
|
local Player = getPlayer(source)
|
||||||
|
|
||||||
TriggerClientEvent("md-drugs:client:GetLocation", src, 'lsd', "Bring Me All The lsd You Have")
|
TriggerClientEvent("md-drugs:client:GetLocation", src, 'lsd', "Bring Me All The lsd You Have")
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:wholesalelsd', function()
|
RegisterServerEvent('md-drugs:server:wholesalelsd', function()
|
||||||
|
|||||||
Reference in new issue
Block a user