lots of shit
This commit is contained in:
1 parent
9e84111da3
commit
1b29aaa3b0
37 files changed
+699
-664
No files matched your search
+4
-6
@@ -50,9 +50,8 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makepowder', function(num)
|
||||
local src = source
|
||||
ps.debug(#(GetEntityCoords(GetPlayerPed(src)) - GlobalState.MDDrugsLocs.MakePowder[num].loc))
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MakePowder[num].loc, 3.5) then
|
||||
Notifys(src, 'You are not in the correct location', 'error')
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
local tier = 'tier1'
|
||||
@@ -71,7 +70,7 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
|
||||
local src = source
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CuttingCoke[num].loc, 2.5) then
|
||||
Notifys(src, 'You are not in the correct location', 'error')
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
@@ -94,7 +93,7 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num)
|
||||
local src = source
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BaggingCoke[num].loc, 2.5) then
|
||||
Notifys(src, 'You are not in the correct location', 'error')
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
@@ -120,10 +119,9 @@ local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3}
|
||||
for k, v in pairs (cokecut) do
|
||||
ps.createUseable(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not ps.hasItem(src, 'bakingsoda') then ps.notify(src, 'You Need Baking Soda For this', 'error') return end
|
||||
if ps.hasItem(src,item.name) then
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting It Further')
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting It Further')
|
||||
if not check then return end
|
||||
if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then
|
||||
ps.addItem(src, 'loosecoke', v)
|
||||
|
||||
@@ -150,7 +150,7 @@ for k, v in pairs(Consume) do
|
||||
local anim = v.anim or Consumables.defaultanim
|
||||
local progressbartext = v.progressbartext or Consumables.defaultprogresstext
|
||||
local add = v.add or {hunger = 0}
|
||||
local done = lib.callback.await('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k)
|
||||
local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k)
|
||||
if done then
|
||||
RemoveItem(source, k, 1)
|
||||
end
|
||||
|
||||
@@ -121,7 +121,7 @@ local Drugs = {
|
||||
["cupofdextro"] = {rep = 1,min = 18, max = 40},
|
||||
}
|
||||
|
||||
lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, ped)
|
||||
ps.registerCallback('md-drugs:server:cornerselling:getAvailableDrugs', function(source, ped)
|
||||
local Player = getPlayer(source)
|
||||
local rep = getRep(source, 'cornerselling')
|
||||
if not Player then return nil end
|
||||
@@ -144,7 +144,7 @@ lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', functio
|
||||
end
|
||||
end)
|
||||
|
||||
lib.callback.register('md-drugs:server:hasDrugs', function(source)
|
||||
ps.registerCallback('md-drugs:server:hasDrugs', function(source)
|
||||
local Player = getPlayer(source)
|
||||
for k, v in pairs(Drugs) do
|
||||
local item = Player.Functions.GetItemByName(k)
|
||||
|
||||
+50
-30
@@ -1,62 +1,82 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local count,type, tier = 0, 'cookcrack', 'tier1'
|
||||
if not checkLoc(src, 'makecrack', num) then return end
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
local crackTiers = {
|
||||
{item = 'loosecoke', tier = 'tier1', log = ' Cut Crack'},
|
||||
{item = 'loosecokestagetwo', tier = 'tier2', log = ' Cut Crack tier 2'},
|
||||
{item = 'loosecokestagethree', tier = 'tier3', log = ' Cut Crack tier 3'}
|
||||
{item = 'loosecoke', tier = 'tier1'},
|
||||
{item = 'loosecokestagetwo', tier = 'tier2'},
|
||||
{item = 'loosecokestagethree', tier = 'tier3'}
|
||||
}
|
||||
for _, v in ipairs(crackTiers) do
|
||||
if count >= 1 then break end
|
||||
if Player.Functions.GetItemByName(v.item) then
|
||||
tier = v.tier
|
||||
count = count + 1
|
||||
if ps.hasItem(src, v.item) then
|
||||
tier = v.tier
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not GetRecipe(src, 'crack', type, tier) then return end
|
||||
if not GetRecipe(src, 'crack', 'cookcrack', tier) then return end
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:bagcrack', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local count,type, tier = 0, 'bagcrack', 'tier1'
|
||||
if not checkLoc(src, 'bagcrack', num) then return end
|
||||
local tier = 'tier1'
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.bagcrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
if Config.TierSystem then
|
||||
local crackTiers = {
|
||||
{item = 'crackrock', tier = 'tier1', log = ' Bagged Crack'},
|
||||
{item = 'crackrockstagetwo', tier = 'tier2', log = ' Bagged Crack tier 2'},
|
||||
{item = 'crackrockstagethree', tier = 'tier3', log = ' Bagged Crack tier 3'}
|
||||
{item = 'crackrock', tier = 'tier1'},
|
||||
{item = 'crackrockstagetwo', tier = 'tier2'},
|
||||
{item = 'crackrockstagethree', tier = 'tier3'}
|
||||
}
|
||||
for _, v in ipairs(crackTiers) do
|
||||
if count >= 1 then break end
|
||||
if Player.Functions.GetItemByName(v.item) then
|
||||
tier = v.tier
|
||||
count = count + 1
|
||||
if ps.hasItem(src, v.item) then
|
||||
tier = v.tier
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not GetRecipe(src, 'crack', type, tier) then return end
|
||||
if not GetRecipe(src, 'crack', 'bagcrack', tier) then return end
|
||||
end)
|
||||
|
||||
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3}
|
||||
for k, v in pairs (cokecut) do
|
||||
CUI(k, function(source, item)
|
||||
ps.createUseable(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.Functions.GetItemByName(item.name) then
|
||||
if not Itemcheck(src, 'bakingsoda', 1) then return end
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
|
||||
if ps.hasItem(src, item.name) then
|
||||
if not ps.hasItem(src, 'bakingsoda', 1) then return end
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
|
||||
if not check then return end
|
||||
if RemoveItem(src, k, 1) and RemoveItem(src, 'bakingsoda', 1) then
|
||||
AddItem(src, 'crackrock', v)
|
||||
if ps.removeItem(src, k, 1) and ps.removeItem(src, 'bakingsoda', 1) then
|
||||
ps.addItem(src, 'crackrock', v)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent("md-drugs:server:failcrackone", function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
|
||||
ps.notify(src, 'You are not in the correct location', 'error')
|
||||
return
|
||||
end
|
||||
local items = {
|
||||
loosecoke = 1,
|
||||
loosecokestagetwo = 1,
|
||||
loosecokestagethree = 1
|
||||
}
|
||||
for k,v in pairs(items) do
|
||||
if ps.hasItem(src, k, v) then
|
||||
ps.removeItem(src, k, v)
|
||||
ps.notify(src, 'You failed to make crack and lost '..v..' '..k, 'error')
|
||||
return
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -80,7 +80,7 @@ local dloc = {
|
||||
{coords = vector4(223.98, 121.53, 102.76, 259.68)},
|
||||
{coords = vector4(102.19, -255.02, 50.05, 83.59)},
|
||||
}
|
||||
lib.callback.register('md-drugs:server:getDealers', function(data)
|
||||
ps.registerCallback('md-drugs:server:getDealers', function(data)
|
||||
local check = MySQL.query.await('SELECT * FROM dealers', {})
|
||||
local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 })
|
||||
if not check[1] then
|
||||
@@ -99,7 +99,7 @@ local DeliveryItems = {
|
||||
{ item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}},
|
||||
}
|
||||
|
||||
lib.callback.register('md-drugs:server:GetDeliveryItem', function(data)
|
||||
ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local itemnum = math.random(1, #DeliveryItems)
|
||||
|
||||
@@ -323,7 +323,7 @@ function getCops()
|
||||
return amount
|
||||
end
|
||||
|
||||
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
|
||||
ps.registerCallback('md-drugs:server:GetCoppers', function(source, cb, args)
|
||||
local amount = 0
|
||||
local players = QBCore.Functions.GetQBPlayers()
|
||||
for k, v in pairs(players) do
|
||||
@@ -334,7 +334,7 @@ lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
|
||||
return amount
|
||||
end)
|
||||
|
||||
lib.callback.register('md-drugs:server:GetRep', function(source, cb, args)
|
||||
ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args)
|
||||
local src = source
|
||||
local rep = GetAllRep(source)
|
||||
return rep
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ function heroinCooldown(loc)
|
||||
end)
|
||||
end
|
||||
|
||||
lib.callback.register('removeCleaningkit', function(source)
|
||||
ps.registerCallback('removeCleaningkit', function(source)
|
||||
local Player = getPlayer(source)
|
||||
for k, v in pairs(heroinLabKits) do
|
||||
if v.ownerid == Player.PlayerData.citizenid then
|
||||
@@ -141,7 +141,7 @@ CUI('heroinlabkit', function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Itemcheck(source, 'heroinlabkit', 1) then return end
|
||||
local placed, loc = lib.callback.await('md-drugs:client:setheroinlabkit', src)
|
||||
local placed, loc = ps.callback('md-drugs:client:setheroinlabkit', src)
|
||||
if placed then
|
||||
RemoveItem(src, 'heroinlabkit', 1)
|
||||
table.insert(heroinLabKits, {
|
||||
|
||||
@@ -134,11 +134,11 @@ function checkLoc(source, event, num)
|
||||
end
|
||||
|
||||
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
|
||||
lib.callback.register('md-drugs:server:getLocs', function()
|
||||
ps.registerCallback('md-drugs:server:getLocs', function()
|
||||
return Target
|
||||
end)
|
||||
|
||||
lib.callback.register('md-drugs:server:GetMerchant', function(source)
|
||||
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
||||
return loc
|
||||
end)
|
||||
|
||||
|
||||
+23
-8
@@ -1,29 +1,44 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
local prices = {
|
||||
tabcost = 100, -- price per piece of tab paper event does 10 at a time
|
||||
lsdlabkitcost = 10000 -- price of the lsd lab kit
|
||||
}
|
||||
|
||||
local timedOut = {}
|
||||
local function timeout(src, time)
|
||||
timedOut[src] = true
|
||||
CreateThread(function()
|
||||
Wait(time)
|
||||
timedOut[src] = nil
|
||||
end)
|
||||
end
|
||||
local lsdTables = {}
|
||||
RegisterServerEvent('md-drugs:server:getlysergic', function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'lysergicacid', num) then return end
|
||||
if AddItem(src,'lysergic_acid', 2) then
|
||||
if timedOut[src] then return end
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.lysergicacid[num].loc, 2.0) then
|
||||
Notifys(src, Lang.lsd.notinloc, "error")
|
||||
return
|
||||
end
|
||||
timeout(src, 3000)
|
||||
ps.addItem(src, 'lysergic_acid', 2)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'diethylamide', num) then return end
|
||||
if AddItem(src,'diethylamide', 2) then
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
|
||||
Notifys(src, Lang.lsd.notinloc, "error")
|
||||
return
|
||||
end
|
||||
if timedOut[src] then return end
|
||||
timeout(src, 3000)
|
||||
ps.addItem(src, 'diethylamide', 2)
|
||||
end)
|
||||
|
||||
|
||||
CUI('lsdlabkit', function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local placed, loc = lib.callback.await('md-drugs:client:setlsdlabkit', src)
|
||||
local placed, loc = ps.callback('md-drugs:client:setlsdlabkit', src)
|
||||
if placed then
|
||||
if RemoveItem(src, 'lsdlabkit', 1) then
|
||||
table.insert(lsdTables, {
|
||||
@@ -46,7 +61,7 @@ local function hasLabKit(source)
|
||||
end
|
||||
end
|
||||
|
||||
lib.callback.register('md-drugs:server:removecleaningkit', function(source)
|
||||
ps.registerCallback('md-drugs:server:removecleaningkit', function(source)
|
||||
local src = source
|
||||
if not Itemcheck(src, 'cleaningkit', 1) then return end
|
||||
if RemoveItem(src,"cleaningkit", 1) then
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ local prices = {
|
||||
hotchance = 30,
|
||||
itemChance = 20,
|
||||
}
|
||||
lib.callback.register('md-drugs:server:payfortruck', function()
|
||||
ps.registerCallback('md-drugs:server:payfortruck', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ CUI('prescription_pad', function(source, item)
|
||||
end
|
||||
end
|
||||
local options = { {label = 'Vicodin', value = 'vicodin_prescription'}, {label = 'Adderal', value = 'adderal_prescription'}, {label = 'Morphine', value = 'morphine_prescription'},{label = 'Xanax', value = 'xanax_prescription'}}
|
||||
local data = lib.callback.await('md-drugs:client:prescriptionpad', src, near, options)
|
||||
local data = ps.callback('md-drugs:client:prescriptionpad', src, near, options)
|
||||
if type(data) == 'table' then
|
||||
local give = QBCore.Functions.GetPlayerByCitizenId(data.who)
|
||||
for i = 1, #options do
|
||||
@@ -42,7 +42,7 @@ for m, d in pairs (pharmabottle) do
|
||||
CUI(d, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check = lib.callback.await("md-drugs:client:unbottle", src)
|
||||
local check = ps.callback("md-drugs:client:unbottle", src)
|
||||
if check then
|
||||
local get = {
|
||||
['vicodinbottle'] = 'vicodin',
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ function GetRecipe(source, type, method, tier)
|
||||
ps.craftItem(source,recipe[type][method][tier])
|
||||
end
|
||||
|
||||
lib.callback.register('md-drugs:server:GetRecipe', function(source, type, cat)
|
||||
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
|
||||
if not source then return false end
|
||||
return recipe[type][cat]
|
||||
end)
|
||||
+1
-1
@@ -53,7 +53,7 @@ local stores = {
|
||||
}
|
||||
}
|
||||
|
||||
lib.callback.register('md-drugs:server:menu', function(source, data)
|
||||
ps.registerCallback('md-drugs:server:menu', function(source, data)
|
||||
local src = source
|
||||
if data == 'travellingMerchant' then
|
||||
return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'}
|
||||
|
||||
+2
-2
@@ -122,7 +122,7 @@ CUI("weedgrinder", function(source, item)
|
||||
local Player = getPlayer(src)
|
||||
local has = Player.Functions.GetItemByName("drycannabis")
|
||||
if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
AddItem(src, "grindedweed", 1)
|
||||
@@ -132,7 +132,7 @@ end)
|
||||
CUI("mdwoods", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "mdwoods",1 ) then
|
||||
AddItem(src, "bluntwrap", 5)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ for k, v in pairs (presses) do
|
||||
CUI(v.item, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data)
|
||||
local check, loc = ps.callback('md-drugs:client:setpress', src, v.data)
|
||||
if check then
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
table.insert(activePresses, {
|
||||
|
||||
Reference in new issue
Block a user