This commit is contained in:
Mustache Dom committed 2024-11-11 20:22:48 -08:00
1 parent c6d8556c12
commit bcdf71b17a
21 files changed
+394 -403

No files matched your search

+47 -23
View File
@@ -1,9 +1,25 @@
local QBCore = exports['qb-core']:GetCoreObject()
local cokeplants = {
{ location = vector3(1474.25, -2643.87, 42.88), heading = 334.49, model = "prop_plant_01a" },
{ location = vector3(1472.35, -2649.3, 41.87), heading = 329.56, model = "prop_plant_01a" },
{ location = vector3(1475.7, -2652.9, 40.8), heading = 25.16, model = "prop_plant_01a" },
{ location = vector3(1481.0, -2654.99, 39.86), heading = 21.52, model = "prop_plant_01a" },
{ location = vector3(1480.9, -2660.63, 38.68), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1477.18, -2666.53, 38.19), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1477.58, -2670.82, 37.73), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1476.56, -2675.82, 37.46), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1474.8, -2680.19, 37.03), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1471.52, -2685.0, 36.82), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1462.82, -2676.58, 38.83), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1461.31, -2667.74, 39.67), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1456.3, -2647.61, 43.39), heading = 202.97, model = "prop_plant_01a" },
{ location = vector3(1453.65, -2641.56, 45.0), heading = 202.97, model = "prop_plant_01a" },
}
GlobalState.CocaPlant = Config.CocaPlant
GlobalState.CocaPlant = cokeplants
Citizen.CreateThread(function()
for _, v in pairs(Config.CocaPlant) do
for _, v in pairs(cokeplants) do
v.taken = false
end
end)
@@ -11,31 +27,31 @@ end)
function CaneCooldown(loc)
CreateThread(function()
Wait(Config.respawnTime * 1000)
Config.CocaPlant[loc].taken = false
GlobalState.CocaPlant = Config.CocaPlant
cokeplants[loc].taken = false
GlobalState.CocaPlant = cokeplants
Wait(1000)
TriggerClientEvent('coke:respawnCane', -1, loc)
Log('Coca Plant Respawned At ' .. Config.CocaPlant[loc].location, 'coke')
Log('Coca Plant Respawned At ' .. cokeplants[loc].location, 'coke')
end)
end
RegisterNetEvent("coke:pickupCane")
AddEventHandler("coke:pickupCane", function(loc)
local src = source
if CheckDist(src, Config.CocaPlant[loc].location) then return end
if not Config.CocaPlant[loc].taken then
Config.CocaPlant[loc].taken = true
GlobalState.CocaPlant = Config.CocaPlant
--if CheckDist(src, Config.CocaPlant[loc].location) then return end
if not cokeplants[loc].taken then
cokeplants[loc].taken = true
GlobalState.CocaPlant = cokeplants
TriggerClientEvent("coke:removeCane", -1, loc)
CaneCooldown(loc)
AddItem(src, 'coca_leaf', 1)
Log(GetName(src) .. ' Picked A Coca Leaf With a distance of ' .. dist(src, Config.CocaPlant[loc].location) .. ' vectors', 'coke')
--Log(GetName(src) .. ' Picked A Coca Leaf With a distance of ' .. dist(src, Config.CocaPlant[loc].location) .. ' vectors', 'coke')
end
end)
RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source
if CheckDist(src, Config.MakePowder[num]['loc']) then return end
if not checkLoc(src, 'MakePowder', num) then return end
local tier = 'tier1'
local logMessage = ' Made Raw Coke'
if Config.TierSystem then
@@ -52,11 +68,16 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
Log(GetName(src) .. logMessage .. dist(src, Config.MakePowder[num]['loc']) .. ' vectors', 'coke')
end)
RegisterServerEvent('md-drugs:server:cutcokeone', function()
RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
local src = source
local Player = getPlayer(src)
local count = 0
if Config.TierSystem then
if Config.FancyCokeAnims then
if not checkLoc(src, 'singleSpot', 'cutcoke') then return end
else
if not checkLoc(src, 'CuttingCoke', num) then return end
end
if Config.TierSystem then
local tier = ''
local cokeTiers = {
{item = 'coke', tier = 'tier1', log = ' Cut Coke'},
@@ -65,12 +86,11 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function()
}
for _, v in ipairs(cokeTiers) do
if count >= 1 then break end
if Player.Functions.GetItemByName(v.item) then
tier = v.tier
if Player.Functions.GetItemByName(v.item) then
tier = v.tier
count = count + 1
end
end
Notifys(src, Lang.Coke.nocutcoke, "error")
if not GetRecipe(src, 'cocaine', 'cutcoke', tier) then return end
else
if not GetRecipe(src, 'cocaine', 'cutcoke', 'tier1') then return end
@@ -78,11 +98,16 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function()
end
end)
RegisterServerEvent('md-drugs:server:bagcoke', function()
RegisterServerEvent('md-drugs:server:bagcoke', function(num)
local src = source
local Player = getPlayer(src)
local count = 0
local count = 0
local tier = ''
if Config.FancyCokeAnims then
if not checkLoc(src, 'singleSpot', 'bagcokepowder') then return end
else
if not checkLoc(src, 'BaggingCoke', num) then return end
end
if Config.TierSystem then
local coke = getRep(src, 'coke')
local cokeTiers = {
@@ -92,14 +117,13 @@ RegisterServerEvent('md-drugs:server:bagcoke', function()
}
for _, v in ipairs(cokeTiers) do
if Player.Functions.GetItemByName(v.item) then
if count >= 1 then break end
count = count + 1
if count >= 1 then break end
count = count + 1
tier = v.tier
end
end
if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end
end
if not GetRecipe(src, 'cocaine', 'bagcoke', tier) then return end
AddRep(src, 'coke')
Notifys(src, Lang.Coke.nobagcoke, "error")
else
if not GetRecipe(src, 'cocaine', 'bagcoke', 'tier1') then return end
Log(GetName(src) .. ' Bagged Coke', 'coke')
+2 -1
View File
@@ -4,7 +4,7 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
local src = source
local Player = getPlayer(src)
local count,type, tier = 0, 'cookcrack', 'tier1'
if CheckDist(src, Config.makecrack[num]['loc']) then return end
if not checkLoc(src, 'makecrack', num) then return end
if Config.TierSystem then
local crackTiers = {
{item = 'loosecoke', tier = 'tier1', log = ' Cut Crack'},
@@ -30,6 +30,7 @@ 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
if Config.TierSystem then
local crackTiers = {
{item = 'crackrock', tier = 'tier1', log = ' Bagged Crack'},
+27 -15
View File
@@ -1,9 +1,23 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.PoppyPlants = Config.PoppyPlants
local h = {
{ location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"},
{ location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"},
{ location = vector3(-2245.57, -85.12, 104.5), heading = 25.16, model = "prop_plant_01b"},
{ location = vector3(-2240.81, -88.48, 105.88), heading = 21.52, model = "prop_plant_01b"},
{ location = vector3(-2240.87, -93.36, 103.88), heading = 334.49, model = "prop_plant_01b"},
{ location = vector3(-2236.0, -95.34, 102.55), heading = 329.56, model = "prop_plant_01b"},
{ location = vector3(-2240.6, -100.01, 100.49), heading = 25.16, model = "prop_plant_01b"},
{ location = vector3(-2246.29, -104.92, 99.27), heading = 21.52, model = "prop_plant_01b"},
{ location = vector3(-2243.64, -107.99, 96.71), heading = 334.49, model = "prop_plant_01b"},
{ location = vector3(-2254.22, -108.76, 97.25), heading = 329.56, model = "prop_plant_01b"},
{ location = vector3(-2247.33, -108.92, 97.70), heading = 25.16, model = "prop_plant_01b"},
{ location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"},
{ location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"},
}
Citizen.CreateThread(function()
for _, v in pairs(Config.PoppyPlants) do
for _, v in pairs(h) do
v.taken = false
end
end)
@@ -12,11 +26,11 @@ end)
function heroinCooldown(loc)
CreateThread(function()
Wait(Config.respawnTime * 1000)
Config.PoppyPlants[loc].taken = false
GlobalState.PoppyPlants = Config.PoppyPlants
h[loc].taken = false
GlobalState.PoppyPlants = h
Wait(1000)
TriggerClientEvent('heroin:respawnCane', -1, loc)
Log('Heroin Plant Respawned At ' .. Config.PoppyPlants[loc].location, 'heroin')
Log('Heroin Plant Respawned At ' .. h[loc].location, 'heroin')
end)
end
@@ -32,20 +46,19 @@ end)
RegisterServerEvent("heroin:pickupCane", function(loc)
if CheckDist(source, Config.PoppyPlants[loc].location) then return end
if not Config.PoppyPlants[loc].taken then
Config.PoppyPlants[loc].taken = true
GlobalState.PoppyPlants = Config.PoppyPlants
if not h[loc].taken then
h[loc].taken = true
GlobalState.PoppyPlants = h
TriggerClientEvent("heroin:removeCane", -1, loc)
heroinCooldown(loc)
AddItem(source, 'poppyresin', 1)
Log(GetName(source) .. ' Picked A Poppies With a distance of ' .. dist(source, Config.PoppyPlants[loc].location) .. ' vectors', 'heroin')
Log(GetName(source) .. ' Picked A Poppies With a distance of ' .. dist(source, h[loc].location) .. ' vectors', 'heroin')
end
end)
RegisterServerEvent('md-drugs:server:dryplant', function(num)
local src = source
if CheckDist(source, Config.dryplant[num]['loc']) then return end
if not checkLoc(source, 'dryplant', num) then return end
if not Itemcheck(source, 'poppyresin', 1) then return end
if Config.TierSystem then
local heroin = getRep(src, 'heroin')
@@ -69,7 +82,7 @@ end)
RegisterServerEvent('md-drugs:server:cutheroin', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.cutheroinone[num]['loc']) then return end
if not checkLoc(source, 'cutheroinone', num) then return end
if not Itemcheck(src, 'bakingsoda', 1) then return end
if Config.TierSystem then
local rawh = Player.Functions.GetItemByName('heroin')
@@ -96,8 +109,7 @@ end)
RegisterServerEvent('md-drugs:server:getheroinlabkit', function()
local src = source
local Player = getPlayer(src)
if CheckDist(source, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) then return end
if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end
if Player.Functions.RemoveMoney('cash', Config.heroinlabkitprice) then
AddItem(src, 'heroinlabkit', 1)
Log(GetName(src) ..' Bought A Heroin lab Kit ' .. dist(source, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) .. ' vectors', 'heroin')
@@ -175,7 +187,7 @@ end)
RegisterServerEvent('md-drugs:server:fillneedle', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.fillneedle[num]['loc']) then return end
if not checkLoc(source, 'fillneedle', num) then return end
if not Itemcheck(src, 'needle', 1) then return end
if Config.TierSystem then
local heroin = getRep(src, 'heroin')
+3 -3
View File
@@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('md-drugs:server:getlysergic', function(num)
local src = source
if CheckDist(src, Config.lysergicacid[num]['loc']) then return end
if not checkLoc(src, 'lysergicacid', num) then return end
if AddItem(src,'lysergic_acid', 2) then
Log(GetName(src) ..' Got Lysergic acid with a distance of ' .. dist(source, Config.lysergicacid[num]['loc']) .. '!', 'lsd')
end
@@ -10,7 +10,7 @@ end)
RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
local src = source
if CheckDist(src, Config.diethylamide[num]['loc']) then return end
if not checkLoc(src, 'diethylamide', num) then return end
if AddItem(src,'diethylamide', 2) then
Log(GetName(src) ..' Got Diethylamide with a distance of ' .. dist(source, Config.diethylamide[num]['loc']) .. '!', 'lsd')
end
@@ -105,7 +105,7 @@ end)
RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.gettabs[num]['loc']) then return end
if not checkLoc(src, 'gettabs', num) then return end
if Player.Functions.RemoveMoney('cash', Config.tabcost * 10) then
AddItem(src,'tab_paper', 10)
Log(GetName(src) ..' Bought Tab Paper!', 'lsd')
+29 -11
View File
@@ -1,8 +1,26 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.Mescaline = Config.Mescaline
local m = {
{ location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"},
{ location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"},
{ location = vector3(2611.63, 4194.18, 41.18), heading = 25.16, model = "prop_cactus_03"},
{ location = vector3(2620.18, 4202.69, 41.5), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2624.26, 4211.75, 42.34), heading = 334.49, model = "prop_cactus_03"},
{ location = vector3(2635.21, 4207.5, 42.49), heading = 329.56, model = "prop_cactus_03"},
{ location = vector3(2644.97, 4193.51, 42.11), heading = 25.16, model = "prop_cactus_03"},
{ location = vector3(2654.21, 4195.31, 41.23), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2653.32, 4206.49, 41.62), heading = 334.49, model = "prop_cactus_03"},
{ location = vector3(2647.45, 4213.94, 42.49), heading = 329.56, model = "prop_cactus_03"},
{ location = vector3(2636.3, 4218.49, 43.03), heading = 25.16, model = "prop_cactus_03"},
{ location = vector3(2627.37, 4223.2, 42.88), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2617.86, 4230.38, 42.63), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2609.8, 4222.12, 41.19), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2602.96, 4194.05, 41.01), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"},
}
Citizen.CreateThread(function()
for _, v in pairs(Config.Mescaline) do
for _, v in pairs(m) do
v.taken = false
end
end)
@@ -10,29 +28,29 @@ end)
function MescalineCooldown(loc)
CreateThread(function()
Wait(Config.respawnTime * 1000)
Config.Mescaline[loc].taken = false
GlobalState.Mescaline = Config.Mescaline
Wait(1000)
m[loc].taken = false
GlobalState.Mescaline = m
TriggerClientEvent('Mescaline:respawnCane', -1, loc)
Log('Cactus Respawned At ' .. Config.Mescaline[loc].location, 'mescaline')
Log('Cactus Respawned At ' ..m[loc].location, 'mescaline')
end)
end
RegisterNetEvent("Mescaline:pickupCane", function(loc)
if CheckDist(source, Config.Mescaline[loc].location) then return end
if not Config.Mescaline[loc].taken then
Config.Mescaline[loc].taken = true
GlobalState.Mescaline = Config.Mescaline
if CheckDist(source, m[loc].location) then return end
if not m[loc].taken then
m[loc].taken = true
GlobalState.Mescaline = m
TriggerClientEvent("Mescaline:removeCane", -1, loc)
MescalineCooldown(loc)
AddItem(source,'cactusbulb', 1)
Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, Config.Mescaline[loc].location) .. ' vectors', 'mescaline')
Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, m[loc].location) .. ' vectors', 'mescaline')
end
end)
RegisterNetEvent("md-drugs:server:drymescaline", function()
local src = source
if not checkLoc(src, 'singleSpot', 'DryOut') then return end
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
Log(GetName(source) .. ' Dried Mescaline', 'mescaline')
end)
+2 -2
View File
@@ -30,7 +30,7 @@ end)
RegisterServerEvent('md-drugs:server:geteph', function(num)
local src = source
if CheckDist(src, Config.MethEph[num]['loc']) then return end
if not checkLoc(src, 'MethEph', num) then return end
if AddItem(src, 'ephedrine', 1) then
Notifys(src, 'Got Ephedrine!', "success")
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth')
@@ -39,7 +39,7 @@ end)
RegisterServerEvent('md-drugs:server:getace', function(num)
local src = source
if CheckDist(src, Config.Methace[num]['loc']) then return end
if not checkLoc(src, 'Methace', num) then return end
if AddItem(src, 'acetone', 1) then
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
Notifys(src, 'Got Acetone!', "success")
+28 -10
View File
@@ -1,9 +1,27 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.shrooms = Config.shrooms
local s = {
{ location = vector3(2185.14, 5183.81, 57.48), heading = 334.49, model = "mushroom"},
{ location = vector3(2174.45, 5187.85, 57.43), heading = 329.56, model = "mushroom"},
{ location = vector3(2166.22, 5196.56, 58.0), heading = 25.16, model = "mushroom"},
{ location = vector3(2166.82, 5204.83, 58.63), heading = 21.52, model = "mushroom"},
{ location = vector3(2174.84, 5205.82, 59.19), heading = 334.49, model = "mushroom"},
{ location = vector3(2184.46, 5201.23, 59.2), heading = 329.56, model = "mushroom"},
{ location = vector3(2192.45, 5194.89, 58.86), heading = 25.16, model = "mushroom"},
{ location = vector3(2207.53, 5187.81, 58.95), heading = 21.52, model = "mushroom"},
{ location = vector3(2213.46, 5191.11, 59.81), heading = 334.49, model = "mushroom"},
{ location = vector3(2218.31, 5180.0, 58.18), heading = 329.56, model = "mushroom"},
{ location = vector3(2212.75, 5172.35, 57.2), heading = 25.16, model = "mushroom"},
{ location = vector3(2208.56, 5167.06, 56.34), heading = 21.52, model = "mushroom"},
{ location = vector3(2196.9, 5158.59, 54.84), heading = 21.52, model = "mushroom"},
{ location = vector3(2191.62, 5174.91, 56.68), heading = 21.52, model = "mushroom"},
{ location = vector3(2190.18, 5182.54, 57.47), heading = 21.52, model = "mushroom"},
{ location = vector3(2185.85, 5190.49, 58.1), heading = 21.52, model = "mushroom"},
{ location = vector3(2179.95, 5194.19, 58.26), heading = 21.52, model = "mushroom"},
}
Citizen.CreateThread(function()
for _, v in pairs(Config.shrooms) do
for _, v in pairs(s) do
v.taken = false
end
end)
@@ -12,23 +30,23 @@ end)
function shroomsCooldown(loc)
CreateThread(function()
Wait(Config.respawnTime * 1000)
Config.shrooms[loc].taken = false
GlobalState.shrooms = Config.shrooms
s[loc].taken = false
GlobalState.shrooms = s
Wait(1000)
TriggerClientEvent('shrooms:respawnCane', -1, loc)
Log('Cactus Respawned At ' .. Config.shrooms[loc].location, 'shrooms')
Log('Cactus Respawned At ' .. s[loc].location, 'shrooms')
end)
end
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
GlobalState.shrooms = Config.shrooms
if CheckDist(source, s[loc].location) then return end
if not s[loc].taken then
s[loc].taken = true
GlobalState.shrooms = s
TriggerClientEvent("shrooms:removeCane", -1, loc)
shroomsCooldown(loc)
AddItem(source, 'shrooms', 1)
Log(GetName(source) .. ' Picked A Shroom With a distance of ' .. dist(source, Config.shrooms[loc].location) .. ' vectors', 'shrooms')
Log(GetName(source) .. ' Picked A Shroom With a distance of ' .. dist(source,s[loc].location) .. ' vectors', 'shrooms')
end
end)
+105
View File
@@ -0,0 +1,105 @@
local Target = {
MakePowder = {
{loc = vector3(1086.20, -3195.30, -39.20), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
{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, gang = ""},
},
BaggingCoke = {
{loc = vector3(1095.61, -3195.62, -39.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
makecrack = {
{loc = vector3(2434.07, 4969.39, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
bagcrack = {
{loc = vector3(2435.85, 4965.3, 42.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
lysergicacid = {
{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 = {
{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 = {
{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 = ""},
},
dryplant = {
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
cutheroinone = {
{loc = vector3(-1360.14, -337.03, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
fillneedle = {
{loc = vector3(-1366.32, -334.40, 44.44), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
isosafrole = {
{loc = vector3(844.39, -902.92, 25.42), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
mdp2p = {
{loc = vector3(844.4, -898.79, 25.23), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
rawxtcloc = {
{loc = vector3(844.71, -910.33, 25.37), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
stamp = {
{loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
FillPrescription = {
{loc = vector3(2432.89, 4252.2, 36.35), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
singleSpot = {
cutcoke = vector3(1093.17, -3195.74, -39.19),
bagcokepowder = vector3(1090.29, -3195.66, -39.13),
CokeTeleIn = vector3(198.16, -1276.92, 29.33),
CokeTeleOut = vector3(1088.81, -3187.57, -38.99),
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51),
buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13),
buypress = vector3(845.82, -884.79, 25.18),
DryOut = vector3(2638.22, 4237.93, 44.78),
SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23),
weedTelein = vector3(244.74, 374.54, 105.74),
weedTeleout = vector3(1066.31, -3183.36, -39.16),
MakeButter = vector3(1045.48, -3198.49, -38.22),
MakeOil = vector3(1038.90, -3198.66, -38.17),
WeedSaleman = vector4(1030.77, -3203.18, -38.2, 262.37),
MethTeleIn = vector3(-2222.04, 303.99, 174.6),
MethTeleOut = vector3(996.91, -3200.83, -36.39),
MethHeistStart = vector3(-1102.93, -3066.76, 14.00),
truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95),
Payfortruck = vector3(1437.64, -1491.91, 63.62)
},
MethEph = {
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
},
Methace = {
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}
}
function checkLoc(source, event, num)
local ped = source
local pos = GetPlayerPed(ped)
local coord = GetEntityCoords(pos)
local loc = ''
if type(num) =='string' then
loc = Target[event][num]
else
loc = Target[event][num].loc
end
local dist = #(coord - loc)
if dist < 2.5 then
return true
else
Notifys(source, 'You are not in the correct location', 'error')
return false
end
end
lib.callback.register('md-drugs:server:getLocs', function()
return Target
end)
+43 -10
View File
@@ -1,10 +1,43 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.WeedPlant = Config.WeedPlant
local weedPlant = {
{ location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1053.08, -3201.11, -39.13), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.91, -3199.99, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1053.02, -3198.97, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.95, -3198.93, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.96, -3199.86, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.93, -3201.17, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.98, -3201.13, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.89, -3200.07, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.89, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.72, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.98, -3200.1, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.82, -3201.01, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1053.07, -3194.51, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.97, -3195.55, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.82, -3196.58, -39.15), heading = 25.16, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1052.94, -3197.59, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.92, -3197.54, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.88, -3196.61, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.82, -3195.52, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1051.95, -3194.38, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.88, -3194.31, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.78, -3195.29, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.76, -3196.49, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1050.77, -3197.62, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.64, -3197.61, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.64, -3196.59, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.62, -3195.51, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
{ location = vector3(1049.66, -3194.36, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
}
GlobalState.WeedPlant = weedPlant
Citizen.CreateThread(function()
for _, v in pairs(Config.WeedPlant) do
for _, v in pairs(weedPlant) do
v.taken = false
end
end)
@@ -12,23 +45,23 @@ end)
function WeedCooldown(loc)
CreateThread(function()
Wait(Config.respawnTime * 1000)
Config.WeedPlant[loc].taken = false
GlobalState.WeedPlant = Config.WeedPlant
weedPlant[loc].taken = false
GlobalState.WeedPlant = weedPlant
Wait(1000)
TriggerClientEvent('weed:respawnCane', -1, loc)
Log('Weed Plant Respawned At ' .. Config.WeedPlant[loc].location, 'weed')
Log('Weed Plant Respawned At ' .. weedPlant[loc].location, 'weed')
end)
end
RegisterNetEvent("weed:pickupCane", function(loc)
local src = source
if not Config.WeedPlant[loc].taken then
Config.WeedPlant[loc].taken = true
GlobalState.WeedPlant = Config.WeedPlant
if not weedPlant[loc].taken then
weedPlant[loc].taken = true
GlobalState.WeedPlant = weedPlant
TriggerClientEvent("weed:removeCane", -1, loc)
WeedCooldown(loc)
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, weedPlant[loc].location) .. ' vectors', 'weed')
end
end)
--------------- events
+19 -20
View File
@@ -3,7 +3,7 @@ local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.isosafrole[num]['loc']) then return end
if not checkLoc(src, 'isosafrole',num) then return end
if AddItem(src, "isosafrole", 1) then
Log(GetName(source) .. ' Stole isosafrole with a distance of ' .. dist(source, Config.isosafrole[num]['loc']) .. ' vectors!', 'xtc')
end
@@ -12,7 +12,7 @@ end)
RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.mdp2p[num]['loc']) then return end
if not checkLoc(src, 'mdp2p',num) then return end
if AddItem(src,"mdp2p", 1) then
Log(GetName(source) .. ' Stole MDP2P with a distance of ' .. dist(source, Config.mdp2p[num]['loc']) .. ' vectors!', 'xtc')
end
@@ -153,25 +153,25 @@ end)
------------- making powder
RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
local src = source
local Player = getPlayer(src)
if CheckDist(source, Config.rawxtcloc[num]['loc']) then return end
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
Log(GetName(source) .. ' Made Raw XTC With A Distance Of ' .. dist(source, Config.rawxtcloc[num]['loc']) .. '!', 'xtc')
end)
RegisterServerEvent('md-drugs:server:stampwhite', function(num)
local src = source
local Player = getPlayer(src)
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 chance2 = math.random(#one)
local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}
local chance3 = math.random(#one)
local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}
local chance4 = math.random(#one)
if CheckDist(source, Config.stamp[num]['loc']) then return end
local src = source
local Player = getPlayer(src)
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 chance2 = math.random(#one)
local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}
local chance3 = math.random(#one)
local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}
local chance4 = math.random(#one)
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "white_xtc", 1) then
AddItem(src, one[chance], 1)
@@ -202,7 +202,7 @@ RegisterServerEvent('md-drugs:server:stampred', function(num)
local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, Config.stamp[num]['loc']) then return end
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "red_xtc", 1) then
AddItem(src, one[chance], 1)
@@ -233,7 +233,7 @@ RegisterServerEvent('md-drugs:server:stamporange', function(num)
local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, Config.stamp[num]['loc']) then return end
if not checkLoc(src, 'stamp', num) then return end
if RemoveItem(src, "orange_xtc", 1) then
AddItem(src, one[chance], 1)
@@ -264,8 +264,7 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num)
local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, Config.stamp[num]['loc']) then return end
Log(GetName(source) .. ' Stamped A Single Blue Pill And Got ' .. one[chance] .. '!', 'xtc')
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