jesussssss

This commit is contained in:
Mustache Dom committed 2025-08-06 02:25:06 -06:00
1 parent daa1a4f8a3
commit 3574ecef5b
32 files changed
+1639 -914

No files matched your search

+59 -7
View File
@@ -1,7 +1,47 @@
local cocaineRecipes = {
cokepowder = {
tier1 = {take = {coca_leaf = 1}, give = {coke = 1}},
tier2 = {take = {coca_leaf = 1}, give = {cokestagetwo = 1}},
tier3 = {take = {coca_leaf = 1}, give = {cokestagethree = 1}},
},
cutcoke = {
tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 1}},
tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 1}},
tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 1}},
},
bagcoke = {
tier1 = {take = {loosecoke = 1, empty_weed_bag = 1}, give = {cokebaggy = 1}},
tier2 = {take = {loosecokestagetwo = 1, empty_weed_bag = 1}, give = {cokebaggystagetwo = 1}},
tier3 = {take = {loosecokestagethree = 1, empty_weed_bag = 1}, give = {cokebaggystagethree = 1}},
}
}
local cocaineLocations = {
MakePowder = {
{loc = vector3(1086.20, -3195.30, -39.20), l = 1.0, w = 1.0, rot = 45.0, gang = "ballas"},
{loc = vector3(1090.15, -3199.5, -39.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(1093.09, -3199.53, -39.05), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
CuttingCoke = {
{loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-1.782227, 0.445068, -0.502701), rotation = vector3(0,0,0), gang = ""},
{loc = vector3(1092.74, -3196.68, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(1.983398, 0.407959, -0.642696), rotation = vector3(0,0,180.0), gang = ""},
},
BaggingCoke = {
{loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0,offset = vec3(4.515137, 2.542969, -0.814194), rotation = vector3(0,0,180.0), gang = ""},
{loc = vector3(1090.17, -3196.59, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-5.207642, -1.666504, -1.014198), rotation = vector3(0,0, 0.0), gang = ""},
},
cokeTele = {
{inside = vector3(1088.81, -3187.57, -38.99), outside = vector3(198.16, -1276.92, 29.33), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}
}
ps.registerCallback('md-drugs:server:GetCokeLocations', function()
return cocaineLocations
end)
RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MakePowder[num].loc, 3.5) then
if not ps.checkDistance(src, cocaineLocations.MakePowder[num].loc, 3.5) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
@@ -14,13 +54,16 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
tier = 'tier3'
end
end
if not GetRecipe(src, 'cocaine', 'cokepowder', tier) then return end
if not ps.craftItem(src, cocaineRecipes['cocaine']['cokepowder'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end)
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
if not ps.checkDistance(src, cocaineLocations.CuttingCoke[num].loc, 2.5) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
@@ -37,13 +80,16 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
end
end
end
if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end
if not ps.craftItem(src, cocaineRecipes['cocaine']['cutcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end)
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
if not ps.checkDistance(src, cocaineLocations.BaggingCoke[num].loc, 2.5) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
@@ -59,10 +105,16 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num)
break
end
end
if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end
if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
AddRep(src, 'coke')
else
if not GetRecipe(src, 'cocaine', 'bagcoke', 'tier1') then return end
if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end
end)
+34 -4
View File
@@ -1,8 +1,32 @@
local crackRecipe = {
cookcrack = {
tier1 = {take = {loosecoke = 1, bakingsoda = 1}, give = {crackrock = 1}},
tier2 = {take = {loosecokestagetwo = 1, bakingsoda = 1}, give = {crackrockstagetwo = 1}},
tier3 = {take = {loosecokestagethree = 1,bakingsoda = 1}, give = {crackrockstagethree = 1}},
},
bagcrack = {
tier1 = {take = {crackrock = 1, empty_weed_bag = 1}, give = {baggedcracked = 1}},
tier2 = {take = {crackrockstagetwo = 1, empty_weed_bag = 1}, give = {baggedcrackedstagetwo = 1}},
tier3 = {take = {crackrockstagethree = 1, empty_weed_bag = 1}, give = {baggedcrackedstagethree = 1}},
}
}
local CrackLocations = {
makecrack = { -- make crack with baking soda with cut coke 1-3
{loc = vector3(2433.47, 4970.02, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
bagcrack = { --- bag crack 1-3 stages
{loc = vector3(2436.55, 4964.96, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
}
ps.registerCallback('md-drugs:server:GetCrackLocations', function()
return CrackLocations
end)
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
local src = source
local tier = 'tier1'
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then
if not ps.checkDistance(src, CrackLocations.makecrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
@@ -19,14 +43,17 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
end
end
end
if not GetRecipe(src, 'crack', 'cookcrack', tier) then return end
if not ps.craftItem(src, crackRecipe['crack']['cookcrack'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end)
RegisterServerEvent('md-drugs:server:bagcrack', function(num)
local src = source
local tier = 'tier1'
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.bagcrack[num].loc, 2.0) then
if not ps.checkDistance(src, CrackLocations.bagcrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error')
return
end
@@ -43,7 +70,10 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
end
end
end
if not GetRecipe(src, 'crack', 'bagcrack', tier) then return end
if not ps.craftItem(src, crackRecipe['crack']['bagcrack'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end)
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3}
+70 -17
View File
@@ -1,4 +1,46 @@
local heroinLabKits = {}
local heroinRecipes = {
dryheroin = {
tier1 = {take = {poppyresin = 1}, give = {heroin = 1}},
tier2 = {take = {poppyresin = 1}, give = {heroinstagetwo = 1}},
tier3 = {take = {poppyresin = 1}, give = {heroinstagethree = 1}},
},
cutheroin = {
tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}},
tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}},
tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}},
},
fillvial = {
tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}},
tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}},
tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}},
},
fillneedle = {
tier1 = {take = {heroinvial = 1, needle = 1}, give = {heroin_ready = 1}},
tier2 = {take = {heroinvialstagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}},
tier3 = {take = {heroinvialstagethree = 1, needle = 1}, give = {heroin_readystagethree = 1}},
}
}
local heroinLocations = {
dryplant = { -- turn resin into powder
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
cutheroinone = { -- cut heroin stage 1-3 with baking soda
{loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
fillneedle = { -- fill needles with heroin
{loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
buyKit = {
{ped = 'a_m_m_farmer_01',loc = vector4(-1366.32, -334.40, 44.44,180.0), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}
}
ps.registerCallback('md-drugs:server:GetHeroinLocations', function(source)
return heroinLocations
end)
local prices = {
heroinlabkitprice = 10000
}
@@ -17,25 +59,28 @@ end)
RegisterServerEvent('md-drugs:server:dryplant', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.dryplant[num].loc, 3.0) then return end
if not ps.checkDistance(src, heroinLocations.dryplant[num].loc, 3.0) then return end
if not ps.hasItem(src, 'poppyresin', 1) then return end
local tier = 'tier1'
if Config.TierSystem then
local heroin = getRep(src, 'heroin')
if heroin <= Config.Tier1 then
if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end
tier = 'tier1'
elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then
if not GetRecipe(src, 'heroin', 'dryheroin', 'tier2') then return end
tier = 'tier2'
else
if not GetRecipe(src, 'heroin', 'dryheroin', 'tier3') then return end
tier = 'tier3'
end
end
if not ps.craftItem(src, heroinRecipes['dryheroin'][tier]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
if not GetRecipe(src, 'heroin', 'dryheroin', 'tier1') then return end
end)
RegisterServerEvent('md-drugs:server:cutheroin', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.cutheroinone[num].loc, 3.0) then return end
if not ps.checkDistance(src, heroinLocations.cutheroinone[num].loc, 3.0) then return end
if not ps.hasItem(src, 'bakingsoda', 1) then return end
if Config.TierSystem then
local itemList = {
@@ -45,20 +90,26 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
}
for k, v in pairs(itemList) do
local cuth = ps.hasItem(src, k)
if cuth then
if not GetRecipe(src, 'heroin', 'cutheroin', v) then return end
if cuth then
if not ps.craftItem(src, heroinRecipes['cutheroin'][v]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
AddRep(src, 'heroin')
return
end
end
else
if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end
if not ps.craftItem(src, heroinRecipes['cutheroin']['tier1']) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
end
end)
RegisterServerEvent('md-drugs:server:getheroinlabkit', function()
RegisterServerEvent('md-drugs:server:getheroinlabkit', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.singleSpot.buyheroinlabkit, 3.0) then return end
if not ps.checkDistance(src, heroinLocations.buyKit[num].loc, 3.0) then return end
local has = ps.hasItem(src, 'heroinlabkit')
if has then ps.notify(src, Lang.Heroin.haskit, 'error') return end
if ps.removeMoney(src, 'cash', prices.heroinlabkitprice) then
@@ -93,7 +144,7 @@ ps.createUseable('heroinlabkit', function(source, item)
local src = source
if not ps.hasItem(src, 'heroinlabkit', 1) then return end
local placed, loc = ps.callback('md-drugs:client:setheroinlabkit', src)
if placed then
if placed then
ps.removeItem(src, 'heroinlabkit', 1)
table.insert(heroinLabKits, {
src = src,
@@ -118,13 +169,16 @@ RegisterServerEvent('md-drugs:server:heatliquidheroin', function()
for k, v in pairs(itemList) do
local cuth = ps.hasItem(src, k)
if cuth then
if not GetRecipe(src, 'heroin', 'fillvial', v) then return end
if not ps.craftItem(src, heroinRecipes['fillvial'][v]) then
ps.notify(src, 'You do not have the required items', 'error')
return
end
AddRep(src, 'heroin')
return
end
end
else
if not GetRecipe(src, 'heroin', 'fillvial', 'tier1') then return end
if not ps.craftItem(src, heroinRecipes['fillvial']['tier1']) then return end
end
end)
@@ -162,15 +216,14 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
for k, v in pairs(itemList) do
local vh = ps.hasItem(src, v.item)
if vh then
if not GetRecipe(src, 'heroin', 'fillneedle', v.tier) then return end
if not ps.craftItem(src, heroinRecipes['fillneedle'][v.tier]) then return end
AddRep(src, 'heroin')
--Log(ps.getPlayerName(src) .. v.log, 'heroin')
return
end
end
ps.notify(src,Lang.Heroin.nofill, "error")
else
if not GetRecipe(src, 'heroin', 'fillneedle', 'tier1') then return end
if not ps.craftItem(src, heroinRecipes['fillneedle']['tier1']) then return end
end
end)
+26 -1
View File
@@ -1,5 +1,30 @@
local onRun = {}
local leanLocs = {
MakeLean = {
{
loc = vector3(2635.81, 4240.57, 45.32),
checks = { -- these can be arrays like {'police', 'ambulance'} or just a single string like 'police'
--gang = {},
--item = {},
--job = {},
--citizenid = {}
}
},
},
SyrupVendor = {
{ped = 'a_m_m_farmer_01', loc = vector4(365.21, -578.77, 39.30, 347.23), l = 1.0, w = 1.0, rot = 347.23, gang = ""},
},
StartLoc = { -- where truck spawns for lean and meth missions
vector3(-2307.22, 434.77, 174.47),
vector3(614.75, 1786.26, 199.39),
vector3(-224.89, 6388.32, 31.59)
},
}
ps.registerCallback('md-drugs:server:GetLeanLocs', function(source)
return leanLocs
end)
local function setTimeout(identifier)
if onRun[identifier] then
@@ -25,7 +50,7 @@ RegisterServerEvent('md-drugs:server:givelean', function()
end)
exports.ps_lib:registerCrafter({
loc = GlobalState.MDDrugsLocs.MakeLean,
loc = leanLocs.MakeLean,
recipes = {
cupoflean = {
amount = 1,
-161
View File
@@ -1,161 +0,0 @@
local Target = {
MakePowder = { -- where you chop your coca leaves to make powder
{loc = vector3(1086.20, -3195.30, -39.20), l = 1.0, w = 1.0, rot = 45.0, gang = "ballas"},
{loc = vector3(1090.15, -3199.5, -39.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(1093.09, -3199.53, -39.05), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
CuttingCoke = { -- only active if Config.FancyCokeAnims = false
{loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-1.782227, 0.445068, -0.502701), rotation = vector3(0,0,0), gang = ""},
{loc = vector3(1092.74, -3196.68, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(1.983398, 0.407959, -0.642696), rotation = vector3(0,0,180.0), gang = ""},
},
BaggingCoke = { -- only active if Config.FancyCokeAnims = false
{loc = vector3(1093.16, -3195.78, -39.19), l = 1.0, w = 1.0, rot = 45.0,offset = vec3(4.515137, 2.542969, -0.814194), rotation = vector3(0,0,180.0), gang = ""},
{loc = vector3(1090.17, -3196.59, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-5.207642, -1.666504, -1.014198), rotation = vector3(0,0, 0.0), gang = ""},
},
makecrack = { -- make crack with baking soda with cut coke 1-3
{loc = vector3(2433.47, 4970.02, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
bagcrack = { --- bag crack 1-3 stages
{loc = vector3(2436.55, 4964.96, 42.18), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
lysergicacid = { -- get lysergic acid
{loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2405.53, 5008.39, 46.02), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
diethylamide = { -- get diethylamide
{loc = vector3(-1371.71, -316.02, 39.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2408.38, 5011.18, 46.08), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
gettabs = { -- buy tab paper
{loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
buyLSDkit = {
{ped = 'g_f_y_families_01', loc = vector4(2598.47, 5033.06, 105.86, 283.51), l = 1.0, w = 1.0, rot = 283.51, gang = ""},
},
dryplant = { -- turn resin into powder
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
cutheroinone = { -- cut heroin stage 1-3 with baking soda
{loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
fillneedle = { -- fill needles with heroin
{loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
isosafrole = { -- where to steal isosafrole
{loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
mdp2p = { -- where to steal mdp2p
{loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
rawxtcloc = { -- where to combine the 2 ingridents to make raw xtc
{loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
stamp = { -- where to stamp pills
{loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
FillPrescription = { -- where to fill out your prescription
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
DryOutMescaline = { -- where to dry out mescaline
{loc = vector3(2638.22, 4237.93, 44.78), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MakeLean = {
{
loc = vector3(2635.81, 4240.57, 45.32),
checks = { -- these can be arrays like {'police', 'ambulance'} or just a single string like 'police'
--gang = {},
--item = {},
--job = {},
--citizenid = {}
}
},
},
CookMeth = {
{loc = vector3(1006.09, -3200.59, -38.52), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(4.79, 2.13, -0.41), rotation = vector3(0,0,0.0), gang = ""},
},
MethDials = {
{loc = vector3(1007.89, -3201.17, -38.99),l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MethSmash = {
{loc = vector3(1012.04, -3194.96, -38.99), bucket = vector4(1012.86, -3194.13, -39.20, 90.00), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-3.143311, -1.666748, -1.010128), rotation = vector3(0,0,0.0), gang = ""},
},
BagMeth = {
{loc = vector3(1014.25, -3194.93, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-4.9, -1.70, -1.01), rotation = vector3(0,0,0.0), gang = ""},
},
MethEph = { -- get ephedrine
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
Methace = { -- get acetone
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MethHeist = {
{loc = vector4(-1520.84, 827.72, 181.66, 184.13), ped = 'a_m_m_farmer_01', gang = ""},
},
SyrupVendor = {
{ped = 'a_m_m_farmer_01', loc = vector4(365.21, -578.77, 39.30, 347.23), l = 1.0, w = 1.0, rot = 347.23, gang = ""},
},
OxyPayForTruck = {
{loc = vector3(1437.64, -1491.91, 63.62), truckSpawn = vector4(1450.87, -1482.13, 63.22, 69.95), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
singleSpot = {
CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke
CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd
buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), -- buy lab kit for heroin
buypress = vector3(845.82, -884.79, 25.18), -- buy lab kit for xtc
weedTelein = vector3(244.74, 374.54, 105.74), -- where you target to tele in
weedTeleout = vector3(1066.31, -3183.36, -39.16), -- where you target to tele out
MakeButter = vector3(1045.48, -3198.49, -38.22), -- where you make cannabutter and baked edibles
MakeOil = vector3(1038.90, -3198.66, -38.17), -- where you make shatter
WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37), -- where the weed saleman is
MethTeleIn = vector3(-2222.04, 303.99, 174.6), -- where you target to tele in meth
MethTeleOut = vector3(996.91, -3200.83, -36.39), -- where you target to tele out meth
MethHeistStart = vector4(-1520.84, 827.72, 181.66, 184.13), -- where you get the mission to get ingridients if meth heist = true
truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it
Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck
},
StartLoc = { -- where truck spawns for lean and meth missions
vector3(-2307.22, 434.77, 174.47),
vector3(614.75, 1786.26, 199.39),
vector3(-224.89, 6388.32, 31.59)
},
WeedDry = {
{loc = vector3(1043.0, -3191.59, -38.39),},
{loc = vector3(1041.0, -3191.59, -38.39),},
{loc = vector3(1045.0, -3191.59, -38.39),},
{loc = vector3(1039.0, -3191.59, -38.39),},
},
Travellingmerchant = { -- where the travelling merchant can spawn
vector4(-119.66, -977.43, 304.25, 88.21),
vector4(-1522.93, 1476.01, 111.45, 41.25),
vector4(-3278.98, 973.38, 5.35, 101.53),
},
oxylocations = {
vector4(-2352.32, 266.78, 165.3, 23.46),
vector4(-1467.49, 874.01, 183.59, 298.45),
vector4(-856.71, 874.26, 202.85, 205.3),
vector4(950.58, -128.49, 74.42, 205.3),
vector4(1152.71, -328.43, 69.21, 205.3),
vector4(112.66, -1955.67, 20.75, 37.94),
vector4(-544.4, -1684.8, 19.89, 252.07),
vector4(-1185.02, -1805.4, 3.91, 184.83),
vector4(-1641.4, -981.99, 7.58, 35.38),
vector4(-1827.93, 782.36, 138.29, 219.99),
vector4(-320.84, 2818.73, 59.45, 337.22),
vector4(474.88, 2609.56, 44.48, 357.0),
}
}
GlobalState.MDDrugsLocs = Target
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
return loc
end)
function getRandW(src)
local rand = math.random(1, #Target.oxylocations)
return Target.oxylocations[rand]
end
+41 -14
View File
@@ -3,6 +3,34 @@ 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 lsdRecipes = {
vial = {
heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 1}}
},
}
local lsdLocations = {
lysergicacid = { -- get lysergic acid
{loc = vector3(-1381.21, -327.75, 39.85), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2405.53, 5008.39, 46.02), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
diethylamide = { -- get diethylamide
{loc = vector3(-1371.71, -316.02, 39.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2408.38, 5011.18, 46.08), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
gettabs = { -- buy tab paper
{loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
buyLSDkit = {
{ped = 'g_f_y_families_01', loc = vector4(2598.47, 5033.06, 105.86, 283.51), l = 1.0, w = 1.0, rot = 283.51, gang = ""},
},
}
ps.registerCallback('md-drugs:server:GetLSDLocations', function(source)
return lsdLocations
end)
local timedOut = {}
local function timeout(src, time)
@@ -18,7 +46,7 @@ local lsdTables = {}
RegisterServerEvent('md-drugs:server:getlysergic', function(num)
local src = source
if timedOut[src] then return end
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.lysergicacid[num].loc, 2.0) then
if not ps.checkDistance(src, lsdLocations.lysergicacid[num].loc, 2.0) then
ps.notify(src, ps.lang('lsd.notinloc'), "error")
return
end
@@ -29,7 +57,7 @@ end)
RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
local src = source
if timedOut[src] then return end
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
if not ps.checkDistance(src, lsdLocations.diethylamide[num].loc, 2.0) then
ps.notify(src, Lang.lsd.notinloc, "error")
return
end
@@ -80,7 +108,10 @@ end)
RegisterServerEvent('md-drugs:server:heatliquid', function()
local src = source
if not hasLabKit(src) then return end
if not GetRecipe(src, 'lsd', 'vial', 'heat') then return end
if not ps.craftItem(src, lsdRecipes['vial']['heat']) then
ps.notify(src, ps.lang('lsd.noliquid'), "error")
return
end
end)
RegisterServerEvent('md-drugs:server:failheating', function()
@@ -89,7 +120,6 @@ RegisterServerEvent('md-drugs:server:failheating', function()
ps.removeItem(src, 'lysergic_acid', 1)
ps.removeItem(src, 'diethylamide', 1)
ps.notify(src, ps.lang('prices.lsd.failed'), "error")
--Log(ps.getPlayerName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd')
end)
@@ -107,28 +137,26 @@ if not ps.hasItem(src, 'lsd_one_vial', 1) then return end
elseif lsd >= 61 and lsd <= 90 then
ps.addItem(src,'lsd_vial_four', 1)
elseif lsd >= 91 and lsd <= 120 then
ps.addItem(src,'lsd_vial_five', 1)
ps.addItem(src,'lsd_vial_five', 1)
else
ps.addItem(src,'lsd_vial_six', 1)
end
AddRep(src,'lsd')
--ps.log(ps.getPlayerName(src) ..' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
end
else
local randomchance = math.random(1,100)
if ps.removeItem(src,'lsd_one_vial', 1) then
if ps.removeItem(src,'lsd_one_vial', 1) then
if randomchance <= 60 then
ps.addItem(src,'lsd_vial_two', 1)
elseif randomchance >= 61 and randomchance <= 75 then
ps.addItem(src,'lsd_vial_three', 1)
elseif randomchance >= 76 and randomchance <= 85 then
ps.addItem(src,'lsd_vial_four', 1)
ps.addItem(src,'lsd_vial_four', 1)
elseif randomchance >= 86 and randomchance <= 93 then
ps.addItem(src,'lsd_vial_five', 1)
else
ps.addItem(src,'lsd_vial_five', 1)
else
ps.addItem(src,'lsd_vial_six', 1)
end
--ps.log(ps.getPlayerName(src) ..' Refined Acid!', 'lsd')
end
end
end)
@@ -142,7 +170,7 @@ end)
RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.gettabs[num].loc, 3.0) then return end
if not ps.checkDistance(src, lsdLocations.gettabs[num].loc, 3.0) then return end
if ps.removeMoney(src, 'cash', prices.tabcost * 10) then
ps.addItem(src,'tab_paper', 10)
else
@@ -156,7 +184,7 @@ RegisterServerEvent('md-drugs:server:getlabkit', function(num)
ps.notify(src, ps.lang('lsd.havlabkit'), 'error')
return
end
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.buyLSDkit[num].loc, 3.0) then return end
if not ps.checkDistance(src, lsdLocations.buyLSDkit[num].loc, 3.0) then return end
if ps.removeMoney(src, 'cash', prices.lsdlabkitcost) then
ps.addItem(src,'lsdlabkit', 1)
else
@@ -201,7 +229,6 @@ for k, v in pairs (sheets) do
local math = math.random(1,10)
if ps.removeItem(src, v.item, 1) then
ps.addItem(src, v.recieve, math)
--ps.log(ps.getPlayerName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
end
end)
end
+10 -3
View File
@@ -1,8 +1,15 @@
local mescalineLocation = {
DryOutMescaline = { -- where to dry out your mescaline
{loc = vector3(1850.12, 2595.23, 45.67), l = 1.0, w = 1.0, rot = 0.0, gang = ""},
},
}
ps.registerCallback('md-drugs:server:GetMescalineLocs', function(source)
return mescalineLocation
end)
RegisterNetEvent("md-drugs:server:drymescaline", function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.DryOutMescaline[num].loc, 3.0) then
if not ps.checkDistance(src, mescalineLocation.DryOutMescaline[num].loc, 3.0) then
ps.notify(src, "You are not in the right location", "error")
return
end
@@ -13,6 +20,6 @@ ps.createUseable("driedmescaline", function(source, item)
local src = source
if ps.removeItem(src, "driedmescaline", 1) then
TriggerClientEvent("md-drugs:client:takemescaline", src)
--Log(GetName(source) .. ' Consumed Mescaline', 'consume')
end
end)
+41 -4
View File
@@ -1,6 +1,42 @@
local onRun = {}
local cool = {}
local methLocs = {
CookMeth = {
{loc = vector3(1006.09, -3200.59, -38.52), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(4.79, 2.13, -0.41), rotation = vector3(0,0,0.0), gang = ""},
},
MethDials = {
{loc = vector3(1007.89, -3201.17, -38.99),l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MethSmash = {
{loc = vector3(1012.04, -3194.96, -38.99), bucket = vector4(1012.86, -3194.13, -39.20, 90.00), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-3.143311, -1.666748, -1.010128), rotation = vector3(0,0,0.0), gang = ""},
},
BagMeth = {
{loc = vector3(1014.25, -3194.93, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-4.9, -1.70, -1.01), rotation = vector3(0,0,0.0), gang = ""},
},
MethEph = { -- get ephedrine
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
Methace = { -- get acetone
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MethHeist = {
{loc = vector4(-1520.84, 827.72, 181.66, 184.13), ped = 'a_m_m_farmer_01', gang = ""},
},
StartLoc = { -- where truck spawns for lean and meth missions
vector3(-2307.22, 434.77, 174.47),
vector3(614.75, 1786.26, 199.39),
vector3(-224.89, 6388.32, 31.59)
},
MethTele = {
{inside = vector3(996.91, -3200.83, -36.39), outside = vector3(-2222.04, 303.99, 174.6), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}
}
ps.registerCallback('md-drugs:server:GetMethLocs', function(source)
return methLocs
end)
local function setTimeout(identifier)
if onRun[identifier] then
CreateThread(function()
@@ -37,6 +73,7 @@ RegisterServerEvent('md-drugs:server:givemethingridients', function()
onRun[ps.getIdentifier(src)] = nil
end
end)
RegisterServerEvent('md-drugs:server:startcook', function(num)
local src = source
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
@@ -45,13 +82,13 @@ end)
RegisterServerEvent('md-drugs:server:getmeth', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BagMeth[num].loc, 2.5) then return end
if not ps.checkDistance(src, methLocs.BagMeth[num].loc, 2.5) then return end
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
end)
RegisterServerEvent('md-drugs:server:geteph', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MethEph[num].loc, 2.5) then return end
if not ps.checkDistance(src, methLocs.MethEph[num].loc, 2.5) then return end
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.wait'), "error") end
if ps.addItem(src, 'ephedrine', 1) then
ps.notify(src, 'Got Ephedrine!', "success")
@@ -60,7 +97,7 @@ end)
RegisterServerEvent('md-drugs:server:getace', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.MethAce[num].loc, 2.5) then return end
if not ps.checkDistance(src, methLocs.MethAce[num].loc, 2.5) then return end
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.wait'), "error") end
if ps.addItem(src, 'acetone', 1) then
ps.notify(src, 'Got Acetone!', "success")
@@ -69,7 +106,7 @@ end)
ps.registerCallback('md-drugs:server:startcook', function(source, num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CookMeth[num].loc, 2.5) then return false end
if not ps.checkDistance(src, methLocs.CookMeth[num].loc, 2.5) then return false end
local recipe = GetRecipe(src, 'meth', 'cook', 'heat')
return recipe
end)
+27 -3
View File
@@ -4,6 +4,30 @@ local prices = {
itemChance = 20,
}
local onRoute = {}
local oxyLocs = {
OxyPayForTruck = {
{loc = vector3(1437.64, -1491.91, 63.62), truckSpawn = vector4(1450.87, -1482.13, 63.22, 69.95), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
oxylocations = {
vector4(-2352.32, 266.78, 165.3, 23.46),
vector4(-1467.49, 874.01, 183.59, 298.45),
vector4(-856.71, 874.26, 202.85, 205.3),
vector4(950.58, -128.49, 74.42, 205.3),
vector4(1152.71, -328.43, 69.21, 205.3),
vector4(112.66, -1955.67, 20.75, 37.94),
vector4(-544.4, -1684.8, 19.89, 252.07),
vector4(-1185.02, -1805.4, 3.91, 184.83),
vector4(-1641.4, -981.99, 7.58, 35.38),
vector4(-1827.93, 782.36, 138.29, 219.99),
vector4(-320.84, 2818.73, 59.45, 337.22),
vector4(474.88, 2609.56, 44.48, 357.0),
}
}
ps.registerCallback('md-drugs:server:GetOxyLocs', function(source)
return oxyLocs
end)
ps.registerCallback('md-drugs:server:payfortruck', function(source)
local src = source
if ps.removeMoney(src, 'cash', prices.payfortruck) or ps.removeMoney(src, 'bank', prices.payfortruck) then
@@ -24,7 +48,7 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
return
end
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.oxylocations[onRoute[src]], 3.5) then
if not ps.checkDistance(src, oxyLocs.oxylocations[onRoute[src]], 3.5) then
ps.notify(src, ps.lang('oxy.toofar'), "error")
return
end
@@ -49,8 +73,8 @@ ps.registerCallback('md-drugs:server:getRoute', function(source)
onRoute[source] = nil
return false
else
onRoute[source] = math.random(1, #GlobalState.MDDrugsLocs.oxylocations)
return GlobalState.MDDrugsLocs.oxylocations[onRoute[source]]
onRoute[source] = math.random(1, #oxyLocs.oxylocations)
return oxyLocs.oxylocations[onRoute[source]]
end
end)
+14 -8
View File
@@ -1,5 +1,12 @@
local QBCore = exports['qb-core']:GetCoreObject()
local pharmaLocations = {
FillPrescription = { -- where to fill out your prescription
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
}
ps.registerCallback('md-drugs:server:GetPharmaLocs', function()
return pharmaLocations
end)
local function GetJob(source)
local src = source
return ps.getJobType(src) == 'ems'
@@ -9,7 +16,7 @@ ps.createUseable('prescription_pad', function(source, item)
local src = source
local near = {}
if GetJob(src) then
local near = ps.getNearbyPlayers(src, 5.0)
near = ps.getNearbyPlayers(src, 5.0)
local options = {
{label = 'Vicodin', value = 'vicodin_prescription'},
@@ -37,10 +44,10 @@ for m, d in pairs (pharmabottle) do
}
for k, v in pairs (get) do
if d == k then
ps.removeItem(src, d, 1)
ps.addItem(src, v, math.random(10,30))
ps.notify(src,ps.lang('Pharma.unbottle'), "success")
--Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
if ps.removeItem(src, d, 1) then
ps.addItem(src, v, math.random(10,30))
ps.notify(src,ps.lang('Pharma.unbottle'), "success")
end
end
end
end
@@ -49,7 +56,7 @@ end
RegisterServerEvent('md-drugs:server:fillprescription', function(num)
local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.FillPrescription[num].loc, 3.5) then
if not ps.checkDistance(src, pharmaLocations.FillPrescription[num].loc, 3.5) then
return ps.notify(src, ps.lang('Pharma.toofar'), "error")
end
local pres = {
@@ -65,5 +72,4 @@ RegisterServerEvent('md-drugs:server:fillprescription', function(num)
break
end
end
--Log(GetName(src) .. ' Filled A Prescription!', 'pharma')
end)
+23 -103
View File
@@ -1,63 +1,6 @@
local QBCore = exports['qb-core']:GetCoreObject()
local recipe = {
cocaine = {
cokepowder = {
tier1 = {take = {coca_leaf = 1}, give = {coke = 1}},
tier2 = {take = {coca_leaf = 1}, give = {cokestagetwo = 1}},
tier3 = {take = {coca_leaf = 1}, give = {cokestagethree = 1}},
},
cutcoke = {
tier1 = {take = {coke = 1, bakingsoda = 1}, give = {loosecoke = 1}},
tier2 = {take = {cokestagetwo = 1, bakingsoda = 1}, give = {loosecokestagetwo = 1}},
tier3 = {take = {cokestagethree = 1, bakingsoda = 1}, give = {loosecokestagethree = 1}},
},
bagcoke = {
tier1 = {take = {loosecoke = 1, empty_weed_bag = 1}, give = {cokebaggy = 1}},
tier2 = {take = {loosecokestagetwo = 1, empty_weed_bag = 1}, give = {cokebaggystagetwo = 1}},
tier3 = {take = {loosecokestagethree = 1, empty_weed_bag = 1}, give = {cokebaggystagethree = 1}},
}
},
crack = {
cookcrack = {
tier1 = {take = {loosecoke = 1, bakingsoda = 1}, give = {crackrock = 1}},
tier2 = {take = {loosecokestagetwo = 1, bakingsoda = 1}, give = {crackrockstagetwo = 1}},
tier3 = {take = {loosecokestagethree = 1,bakingsoda = 1}, give = {crackrockstagethree = 1}},
},
bagcrack = {
tier1 = {take = {crackrock = 1, empty_weed_bag = 1}, give = {baggedcracked = 1}},
tier2 = {take = {crackrockstagetwo = 1, empty_weed_bag = 1}, give = {baggedcrackedstagetwo = 1}},
tier3 = {take = {crackrockstagethree = 1, empty_weed_bag = 1}, give = {baggedcrackedstagethree = 1}},
}
},
heroin = {
dryheroin = {
tier1 = {take = {poppyresin = 1}, give = {heroin = 1}},
tier2 = {take = {poppyresin = 1}, give = {heroinstagetwo = 1}},
tier3 = {take = {poppyresin = 1}, give = {heroinstagethree = 1}},
},
cutheroin = {
tier1 = {take = {heroin = 1, bakingsoda = 1}, give = {heroincut = 1}},
tier2 = {take = {heroinstagetwo = 1, bakingsoda = 1}, give = {heroincutstagetwo = 1}},
tier3 = {take = {heroinstagethree = 1, bakingsoda = 1}, give = {heroincutstagethree = 1}},
},
fillvial = {
tier1 = {take = {heroincut = 1, emptyvial = 1}, give = {heroinvial = 1}},
tier2 = {take = {heroincutstagetwo = 1, emptyvial = 1}, give = {heroinvialstagetwo = 1}},
tier3 = {take = {heroincutstagethree = 1, emptyvial = 1}, give = {heroinvialstagethree = 1}},
},
fillneedle = {
tier1 = {take = {heroinvial = 1, needle = 1}, give = {heroin_ready = 1}},
tier2 = {take = {heroinvialstagetwo = 1, needle = 1}, give = {heroin_readystagetwo = 1}},
tier3 = {take = {heroinvialstagethree = 1, needle = 1}, give = {heroin_readystagethree = 1}},
}
},
lsd = {
vial = {
heat = {take = {lysergic_acid = 1, diethylamide = 1,}, give = {lsd_one_vial = 1}}
},
},
recipe = {
mescaline = {
dry = {
dried = {take = {cactusbulb = 1}, give = {driedmescaline = 1} }
@@ -78,13 +21,6 @@ local recipe = {
}
},
weed = {
edibles = {
cannabutter = {take = { mdbutter = 1, grindedweed = 1}, give = {cannabutter = 1}},
specialbrownie = {take = { cannabutter = 1, flour = 1, chocolate = 1}, give = {specialbrownie = 1}},
specialcookie = { take = { cannabutter = 1, flour = 1}, give = {specialcookie = 1}},
specialchocolate = { take = { cannabutter = 1, chocolate = 1}, give = {specialchocolate = 1}},
specialmuffin = { take = { cannabutter = 1, flour = 1}, give = {specialmuffin = 1}},
},
oil = {
shatter = {take = {butane = 1, grindedweed = 1}, give = {shatter = 1}}
},
@@ -99,48 +35,32 @@ local recipe = {
dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}},
}
},
xtc = {
raw = {
raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}}
},
singlestack = {
white = {take = {raw_xtc = 1}, give = {white_xtc = 1}},
red = {take = {raw_xtc = 1, loosecoke = 1 }, give = {red_xtc = 1}},
orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc = 1}},
blue = {take = {raw_xtc = 1, crackrock = 1 }, give = {blue_xtc = 1}},
},
dualstack = {
white = {take = {raw_xtc = 1}, give = {white_xtc2 = 1}},
red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc2 = 1}},
orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc2 = 1}},
blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc2 = 1}},
},
triplestack = {
white = {take = {raw_xtc = 1}, give = {white_xtc3 = 1}},
red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc3 = 1}},
orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc3 = 1}},
blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc3 = 1}},
},
quadstack = {
white = {take = {raw_xtc = 1}, give = {white_xtc4 = 1}},
red = {take = {raw_xtc = 1, loosecoke = 1}, give = {red_xtc4 = 1}},
orange = {take = {raw_xtc = 1, heroinvial = 1}, give = {orange_xtc4 = 1}},
blue = {take = {raw_xtc = 1, crackrock = 1}, give = {blue_xtc4 = 1}},
},
press = {
dual = {take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}, give = {dualpress = 1}},
triple = {take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}, give = {triplepres = 1}},
quad = { take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}, give = {quadpress = 1}}
}
}
}
function GetRecipe(source, type, method, tier)
print(ps.craftItem(source,recipe[type][method][tier]))
return ps.craftItem(source,recipe[type][method][tier])
return ps.craftItem(source, recipe[type][method][tier])
end
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
if not source then return false end
return recipe[type][cat]
end)
end)
function craft(source, tbl, item)
local src = source
local need, have = 0,0
for k, v in pairs(tbl.take) do
if ps.hasItem(src, k, v) then
have = have + v
end
need = need + v
end
if need == have then
for k, v in pairs (tbl.take) do
ps.removeItem(src, k, v)
end
ps.addItem(src, item , tbl.amount)
return true
end
return false
end
+20 -11
View File
@@ -1,4 +1,22 @@
local QBCore = exports['qb-core']:GetCoreObject()
local Target = {
Travellingmerchant = { -- where the travelling merchant can spawn
vector4(-119.66, -977.43, 304.25, 88.21),
vector4(-1522.93, 1476.01, 111.45, 41.25),
vector4(-3278.98, 973.38, 5.35, 101.53),
},
}
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
return loc
end)
function getRandW(src)
local rand = math.random(1, #Target.oxylocations)
return Target.oxylocations[rand]
end
local stores = {
travel = {
@@ -27,16 +45,7 @@ local stores = {
{name = "leancup", price = 25, amount = 50, },
{name = "xtcburner", price = 25, amount = 50, },
},
Weed = {
{name = "weedgrinder", price = 25, amount = 50, },
{name = "mdbutter", price = 25, amount = 50, },
{name = "flour", price = 25, amount = 50, },
{name = "chocolate", price = 25, amount = 50, },
{name = "butane", price = 25, amount = 50, },
{name = "butanetorch", price = 2, amount = 1000,},
{name = "dabrig", price = 2, amount = 1000,},
{name = "mdwoods", price = 2, amount = 1000},
},
Products = {
{name = "weed_white-widow_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0},
+7 -6
View File
@@ -1,10 +1,11 @@
CUI('shrooms', function(source, item)
local src = source
if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then
RemoveItem(src, 'shrooms', 1)
--Log(GetName(source) .. ' Took Some Mushrooms', 'shrooms')
ps.createUseable('shrooms', function(source, item)
local src = source
if not ps.callback("md-drugs:client:shrooms", src) then
ps.notify(src, ps.lang('Shrooms.cancel'), "error")
return
end
ps.removeItem(src, 'shrooms', 1)
ps.notify(src, 'You Took Some Shrooms!', 'success')
end
end)
+141 -34
View File
@@ -1,51 +1,90 @@
local weedLocs = {
WeedTele = { -- where you tele out of weed
{inside = vector3(1066.31, -3183.36, -39.16), outside = vector3(244.74, 374.54, 105.74), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
MakeButter = {
{loc = vector3(1045.48, -3198.49, -38.22), checks = {}},
},
MakeOil = {
{loc = vector3(1038.90, -3198.66, -38.17), checks = {}},
},
WeedDry = {
{loc = vector3(1043.0, -3191.59, -38.39),},
{loc = vector3(1041.0, -3191.59, -38.39),},
{loc = vector3(1045.0, -3191.59, -38.39),},
{loc = vector3(1039.0, -3191.59, -38.39),},
},
WeedSalesman = {
{loc = vector4(1030.77, -3203.18, -38.2, 262.37), ped = 'a_m_m_farmer_01', gang = ""},
},
}
local weedStore = {
weedgrinder =25,
mdbutter =25,
flour =25,
chocolate =25,
butane =25,
butanetorch =2,
dabrig =2,
mdwoods =2,
}
--------------- events
ps.registerCallback('md-drugs:server:GetWeedLocs', function(source)
return weedLocs
end)
ps.registerCallback('md-drugs:server:getWeedItems', function(source)
return weedStore
end)
RegisterNetEvent('md-drugs:server:buyWeedItem', function(loc, name, amount)
local src = source
if not ps.checkDistance(src, weedLocs.WeedSalesman[loc].loc, 3.5) then
ps.notify(src, ps.lang('Weed.notHere'), "error")
return
end
if not weedStore[name] then
ps.notify(src, ps.lang('Weed.notHere'), "error")
return
end
if ps.removeMoney(src, 'cash', weedStore[name] * amount) or ps.removeMoney(src, 'bank', weedStore[name] * amount) then
ps.addItem(src, name, amount)
else
ps.notify(src, ps.lang('Weed.noMoney'), "error")
end
end)
RegisterServerEvent('md-drugs:server:dryoutweed', function()
local src = source
local Player = getPlayer(src)
if RemoveItem(src,"wetcannabis", 1) then
AddItem(src,"drycannabis", 1)
--Log(GetName(source) .. ' Dried Weed', 'weed')
if ps.removeItem(src,"wetcannabis", 1) then
ps.addItem(src,"drycannabis", 1)
else
ps.notify(src, Lang.Weed.nodry, "error")
ps.notify(src, ps.lang('Weed.nodry'), "error")
end
end)
local bluntwrap = {'mdreddextro','mdlean'}
for k, v in pairs (bluntwrap) do
CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:makeBluntWrap', source) end)
ps.createUseable(v, function(source, item) TriggerClientEvent('md-drugs:client:makeBluntWrap', source) end)
end
local bluntwraps = {'leanbluntwrap', 'dextrobluntwrap', 'bluntwrap'}
for k, v in pairs (bluntwraps) do
CUI(v, function(source, item) TriggerClientEvent('md-drugs:client:rollBlunt', source) end)
ps.createUseable(v, function(source, item) TriggerClientEvent('md-drugs:client:rollBlunt', source) end)
end
RegisterServerEvent('md-drugs:server:MakeWeedItems', function(data)
local src = source
local Player = getPlayer(src)
if not Player then return end
if not GetRecipe(src, data.recipe, data.table, data.item) then return end
end)
RegisterServerEvent('md-drugs:server:makeoil', function(data)
local src = source
local Player = getPlayer(src)
if not Player then return end
if not GetRecipe(src, 'weed', 'oil', 'shatter') then return end
end)
CUI("dabrig", function(source, item)
ps.createUseable("dabrig", function(source, item)
local src = source
local Player = getPlayer(src)
if Player.Functions.GetItemByName("butanetorch") then
if RemoveItem(src, "shatter", 1) then
if ps.hasItem(src, "butanetorch") then
if ps.removeItem(src, "shatter", 1) then
TriggerClientEvent("md-drugs:client:dodabs", src)
end
else
@@ -53,25 +92,93 @@ CUI("dabrig", function(source, item)
end
end)
CUI("weedgrinder", function(source, item)
ps.createUseable("weedgrinder", function(source, item)
local src = source
local Player = getPlayer(src)
local has = Player.Functions.GetItemByName("drycannabis")
if not has then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
if not ps.hasItem(src, "drycannabis") then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
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)
if ps.removeItem(src, "drycannabis",1 ) then
ps.addItem(src, "grindedweed", 1)
end
end)
CUI("mdwoods", function(source, item)
ps.createUseable("mdwoods", function(source, item)
local src = source
local Player = getPlayer(src)
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)
AddItem(src, "tobacco", 5)
if ps.removeItem(src, "mdwoods",1 ) then
ps.addItem(src, "bluntwrap", 5)
ps.addItem(src, "tobacco", 5)
end
end)
exports['ps_lib']:registerCrafter({
loc = weedLocs.MakeButter,
recipes = {
cannabutter = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
mdbutter = 1,
grindedweed = 1
}
},
specialbrownie = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
cannabutter = 1,
flour = 1,
chocolate = 1
}
},
specialcookie = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
cannabutter = 1,
flour = 1
}
},
specialchocolate = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
cannabutter = 1,
chocolate = 1
}
},
specialmuffin = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
cannabutter = 1,
flour = 1
}
}
}
})
exports['ps_lib']:registerCrafter({
loc = weedLocs.MakeOil,
recipes = {
shatter = {
amount = 1,
time = 4000,
anim = 'uncuff',
recipe = {
butane = 1,
grindedweed = 1
}
}
}
})
+172 -211
View File
@@ -1,251 +1,212 @@
local QBCore = exports['qb-core']:GetCoreObject()
-------------------- stealing ingridients
local RecipeList = {
raw = {
raw_xtc = {take = {mdp2p = 1, isosafrole = 1}, give = {raw_xtc = 1}}
},
singlestack = {
white_xtc = {amount = 1, take = {raw_xtc = 1}},
red_xtc = {amount = 1, take = {raw_xtc = 1, loosecoke = 1},},
orange_xtc = {amount = 1, take = {raw_xtc = 1, heroinvial = 1},},
blue_xtc = {amount = 1, take = {raw_xtc = 1, crackrock = 1},},
},
dualstack = {
white_xtc2 = {amount = 1, take = {raw_xtc = 1},},
red_xtc2 = {amount = 1, take = {raw_xtc = 1, loosecoke = 1},},
orange_xtc2 = {amount = 1, take = {raw_xtc = 1, heroinvial = 1},},
blue_xtc2 = {amount = 1, take = {raw_xtc = 1, crackrock = 1},},
},
triplestack = {
white_xtc3 = {amount = 1, take = {raw_xtc = 1},},
red_xtc3 = {amount = 1, take = {raw_xtc = 1, loosecoke = 1},},
orange_xtc3 = {amount = 1, take = {raw_xtc = 1, heroinvial = 1},},
blue_xtc3 = {amount = 1, take = {raw_xtc = 1, crackrock = 1},},
},
quadstack = {
white_xtc4 = {amount = 1, take = {raw_xtc = 1},},
red_xtc4 = {amount = 1, take = {raw_xtc = 1, loosecoke = 1},},
orange_xtc4 = {amount = 1, take = {raw_xtc = 1, heroinvial = 1},},
blue_xtc4 = {amount = 1, take = {raw_xtc = 1, crackrock = 1},},
},
presses = {
singlepress = {cash = 10000},
dualpress = {amount = 1, take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}},
triplepress = {amount = 1, take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}},
quadpress = {amount = 1, take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}},
}
}
local xtcLocations = {
isosafrole = { -- where to steal isosafrole
{loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
mdp2p = { -- where to steal mdp2p
{loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
rawxtcloc = { -- where to combine the 2 ingridents to make raw xtc
{loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
xtcpress = {
{ped = 'g_f_y_families_01',loc = vector4(845.82, -884.79, 25.18, 180.0), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
stamp = { -- where to stamp pills
{loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
}
ps.registerCallback('md-drugs:server:GetXtcLocs', function(source)
return xtcLocations
end)
local activePresses = {}
local timeout = {}
local function timeOut(src)
CreateThread(function()
timeout[ps.getIdentifier(src)] = true
Wait(3000)
timeout[ps.getIdentifier(src)] = nil
end)
end
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
local src = source
if not checkLoc(src, 'isosafrole',num) then return end
if AddItem(src, "isosafrole", 1) then
end
if not ps.checkDistance(src, xtcLocations.isosafrole[num].loc, 3.0) then return end
if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error')
return
end
timeOut(src)
ps.addItem(src, "isosafrole", 1)
end)
RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
local src = source
local Player = getPlayer(src)
if not checkLoc(src, 'mdp2p',num) then return end
if AddItem(src,"mdp2p", 1) then
end
if not ps.checkDistance(src, xtcLocations.mdp2p[num].loc, 3.0) then return end
if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error')
return
end
timeOut(src)
ps.addItem(src, "mdp2p", 1)
end)
local presses = {
{item = 'singlepress', data = 'single'},
{item = 'dualpress', data = 'dual'},
{item = 'triplepress', data = 'triple'},
{item = 'quadpress', data = 'quad'},
{item = 'singlepress', data = 'singlestack', recipes = RecipeList.singlestack},
{item = 'dualpress', data = 'dualstack', recipes = RecipeList.dualstack},
{item = 'triplepress', data = 'triplestack', recipes = RecipeList.triplestack},
{item = 'quadpress', data = 'quadstack', recipes = RecipeList.quadstack},
}
for k, v in pairs (presses) do
CUI(v.item, function(source, item)
local src = source
local Player = getPlayer(src)
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, {
press = v.data,
get = v.item,
owner = GetName(src),
ownerid = Player.PlayerData.citizenid,
src = src,
loc = loc
})
end
end
end)
end
RegisterServerEvent('md-drugs:server:getpressback', function(type)
local src = source
local Player = getPlayer(src)
for k, v in pairs (activePresses) do
if v.ownerid == Player.PlayerData.citizenid then
if v.press == type then
table.remove(activePresses, k)
AddItem(src, v.get, 1)
end
end
end
end)
local function pressout(source)
for k, v in pairs (presses) do
ps.createUseable(v.item, function(source, item)
local src = source
local Player = getPlayer(src)
local ped = GetPlayerPed(src)
local coords = GetEntityCoords(ped)
for k, v in pairs (activePresses) do
if v.ownerid == Player.PlayerData.citizenid then
if #(coords - v.loc) < 3.0 then
return v.press
local check, loc = ps.callback('md-drugs:client:setpress', src, v)
if check then
if ps.removeItem(src, v.item, 1) then
activePresses[ps.getIdentifier(src)] = {
press = v.data,
get = v.item,
owner = ps.getPlayerName(src),
ownerid = ps.getIdentifier(src),
src = src,
loc = loc
}
end
end
end
return 'none'
end)
end
RegisterServerEvent('md-drugs:server:getpressback', function()
local src = source
if not activePresses[ps.getIdentifier(src)] then return end
local press = activePresses[ps.getIdentifier(src)]
ps.addItem(src, press.get, 1)
activePresses[ps.getIdentifier(src)] = nil
end)
RegisterServerEvent('md-drugs:server:makextc', function(data)
local src = source
local Player = getPlayer(src)
if not Itemcheck(src, 'raw_xtc', 1) then return end
if pressout(src) == 'none' then return end
if pressout(src) == 'single' then
if data.color == 'white' then
if not GetRecipe(src, 'xtc', 'singlestack', 'white') then return end
elseif data.color == 'red' then
if not GetRecipe(src, 'xtc', 'singlestack', 'red') then return end
elseif data.color == 'orange' then
if not GetRecipe(src, 'xtc', 'singlestack', 'orange') then return end
elseif data.color == 'blue' then
if not GetRecipe(src, 'xtc', 'singlestack', 'blue') then return end
end
elseif pressout(src) == 'dual' then
if data.color == 'white' then
if not GetRecipe(src, 'xtc', 'dualstack', 'white') then return end
elseif data.color == 'red' then
if not GetRecipe(src, 'xtc', 'dualstack', 'red') then return end
elseif data.color == 'orange' then
if not GetRecipe(src, 'xtc', 'dualstack', 'orange') then return end
elseif data.color == 'blue' then
if not GetRecipe(src, 'xtc', 'dualstack', 'blue') then return end
end
elseif pressout(src) == 'triple' then
if data.color == 'white' then
if not GetRecipe(src, 'xtc', 'triplestack', 'white') then return end
elseif data.color == 'red' then
if not GetRecipe(src, 'xtc', 'triplestack', 'red') then return end
elseif data.color == 'orange' then
if not GetRecipe(src, 'xtc', 'triplestack', 'orange') then return end
elseif data.color == 'blue' then
if not GetRecipe(src, 'xtc', 'triplestack', 'blue') then return end
end
elseif pressout(src) == 'quad' then
if data.color == 'white' then
if not GetRecipe(src, 'xtc', 'quadstack', 'white') then return end
elseif data.color == 'red' then
if not GetRecipe(src, 'xtc', 'quadstack', 'red') then return end
elseif data.color == 'orange' then
if not GetRecipe(src, 'xtc', 'quadstack', 'orange') then return end
elseif data.color == 'blue' then
if not GetRecipe(src, 'xtc', 'quadstack', 'blue') then return end
end
end
local src = source
if not activePresses[ps.getIdentifier(src)] then
ps.notify(src, 'You Dont Have A Pill Press', 'error')
return
end
craft(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data], data)
end)
RegisterServerEvent('md-drugs:server:buypress', function()
local src = source
local Player = getPlayer(src)
if Player.Functions.RemoveMoney("cash", 20000) then
AddItem(src, "singlepress", 1)
--Log(GetName(source) .. ' Bought A Pill Press', 'xtc')
else
ps.notify(Lang.xtc.cash, "error")
end
end)
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
local src = source
if data == 'dual' then
if not GetRecipe(src, 'xtc', 'press', 'dual') then return end
elseif data == 'triple' then
if not GetRecipe(src, 'xtc', 'press', 'triple') then return end
elseif data == 'quad' then
if not GetRecipe(src, 'xtc', 'press', 'quad') then return end
if ps.removeMoney(src,"cash", RecipeList.presses['singlepress'].cash) then
ps.addItem(src, "singlepress", 1)
else
ps.notify(src, 'huh', 'error')
ps.notify(ps.lang('xtc.cash'), "error")
end
end)
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
local src = source
if not ps.checkDistance(src, xtcLocations.xtcpress[data].loc, 2.0) then
ps.notify(src, ps.lang('xtc.toofar'), "error")
return
end
craft(src, RecipeList.presses[data], data)
end)
ps.registerCallback('md-drugs:server:getpressrecipes', function(source)
return RecipeList.presses
end)
------------- making powder
RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
local src = source
local Player = getPlayer(src)
if not checkLoc(src, 'rawxtcloc',num) then return end
if not GetRecipe(src, 'xtc', 'raw', 'raw_xtc') then return end
end)
RegisterServerEvent('md-drugs:server:stampwhite', function(num)
local src = source
local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'}
local chance = math.random(#one)
local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'}
local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}
local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "white_xtc", 1) then
AddItem(src, one[chance], 1)
elseif RemoveItem(src, "white_xtc2", 1) then
AddItem(src, two[chance], 1)
elseif RemoveItem(src, "white_xtc3", 1) then
AddItem(src, three[chance], 1)
elseif RemoveItem(src, "white_xtc4", 1) then
AddItem(src, four[chance], 1)
else
ps.notify('You Dont Have Unstamped White Pills', 'error')
if not ps.checkDistance(src, xtcLocations.rawxtcloc[num].loc, 3.0) then return end
if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error')
return
end
timeOut(src)
if not ps.craftItem(src, RecipeList.raw.raw_xtc) then return end
end)
RegisterServerEvent('md-drugs:server:stampred', function(num)
local src = source
local one = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'}
local chance = math.random(#one)
local two = {'red_playboys2', 'red_aliens2', 'red_pl2', 'red_trolls2', 'red_cats2'}
local three = {'red_playboys3', 'red_aliens3', 'red_pl3', 'red_trolls3', 'red_cats3'}
local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'}
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "red_xtc", 1) then
AddItem(src, one[chance], 1)
elseif RemoveItem(src, "red_xtc2", 1) then
AddItem(src, two[chance], 1)
elseif RemoveItem(src, "red_xtc3", 1) then
AddItem(src, three[chance], 1)
elseif RemoveItem(src, "red_xtc4", 1) then
AddItem(src, four[chance], 1)
else
ps.notify('You Dont Have Unstamped red Pills', 'error')
end
end)
local function getColor(color)
local colors = {
white = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'},
red = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'},
orange = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'},
blue = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'}
}
if colors[color] then
return colors[color][math.random(#colors[color])]
else
ps.notify('Invalid color specified', 'error')
return nil
end
end
RegisterServerEvent('md-drugs:server:stamporange', function(num)
local src = source
local one = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'}
local two = {'orange_playboys2', 'orange_aliens2', 'orange_pl2', 'orange_trolls2', 'orange_cats2'}
local three = {'orange_playboys3', 'orange_aliens3', 'orange_pl3', 'orange_trolls3', 'orange_cats3'}
local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'}
local chance = math.random(#one)
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "orange_xtc", 1) then
AddItem(src, one[chance], 1)
elseif RemoveItem(src, "orange_xtc2", 1) then
AddItem(src, two[chance], 1)
elseif RemoveItem(src, "orange_xtc3", 1) then
AddItem(src, three[chance], 1)
elseif RemoveItem(src, "orange_xtc4", 1) then
AddItem(src, four[chance], 1)
else
ps.notify('You Dont Have Unstamped orange Pills', 'error')
end
end)
RegisterServerEvent('md-drugs:server:stampblue', function(num)
local src = source
local one = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'}
local chance = math.random(#one)
local two = {'blue_playboys2', 'blue_aliens2', 'blue_pl2', 'blue_trolls2', 'blue_cats2'}
local three = {'blue_playboys3', 'blue_aliens3', 'blue_pl3', 'blue_trolls3', 'blue_cats3'}
local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'}
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "blue_xtc", 1) then
AddItem(src, one[chance], 1)
elseif RemoveItem(src, "blue_xtc2", 1) then
AddItem(src, two[chance], 1)
elseif RemoveItem(src, "blue_xtc3", 1) then
AddItem(src, three[chance], 1)
elseif RemoveItem(src, "blue_xtc4", 1) then
AddItem(src, four[chance], 1)
else
ps.notify('You Dont Have Unstamped blue Pills', 'error')
end
RegisterServerEvent('md-drugs:server:stamp', function(num, color)
local src = source
if not ps.checkDistance(src, xtcLocations.stamp[num].loc, 3.0) then return end
local item = getColor(color)
local colors = {
white = 'white_xtc',
red = 'red_xtc',
orange = 'orange_xtc',
blue = 'blue_xtc'
}
if ps.removeItem(src, colors[color], 1) then
ps.addItem(src, item, 1)
elseif ps.removeItem(src, colors[color].."2", 1) then
ps.addItem(src, item..'2', 1)
elseif ps.removeItem(src, colors[color].."3", 1) then
ps.addItem(src, item..'3', 1)
elseif ps.removeItem(src, colors[color].."4", 1) then
ps.addItem(src, item..'4', 1)
else
ps.notify('You Dont Have Unstamped '..color..' Pills', 'error')
end
end)
AddEventHandler('playerDropped', function()
local src = source
local Player = getPlayer(src)
for k, v in pairs (activePresses) do
if v.ownerid == Player.PlayerData.citizenid then
table.remove(activePresses, k)
AddItem(src, v.get, 1)
end
if activePresses[ps.getIdentifier(src)] then
ps.addItem(src, activePresses[ps.getIdentifier(src)].get, 1)
activePresses[ps.getIdentifier(src)] = nil
end
end)