added a lot

moved some functions around, added better ox inv options so no longer requires items in qb-core 
changed call backs to oxlib callbacks
cried twice
added new func
This commit is contained in:
Mustache Dom authored and GitHub committed 2024-07-11 17:39:58 -07:00
1 parent 5448eabd87
commit b6b4776ab2
16 files changed
+125 -79

No files matched your search

+8 -6
View File
@@ -9,9 +9,10 @@ RegisterNetEvent('coke:respawnCane', function(loc)
--if not HasModelLoaded(hash) then LoadModel(hash) end --if not HasModelLoaded(hash) then LoadModel(hash) end
if not CocaPlant[loc] then if not CocaPlant[loc] then
CocaPlant[loc] = CreateObject(hash, v.location, false, true, true) CocaPlant[loc] = CreateObject(hash, v.location, false, true, true)
SetEntityAsMissionEntity(CocaPlant[loc], true, true) -- SetEntityAsMissionEntity(CocaPlant[loc], true, true)
FreezeEntityPosition(CocaPlant[loc], true) -- FreezeEntityPosition(CocaPlant[loc], true)
SetEntityHeading(CocaPlant[loc], v.heading) -- SetEntityHeading(CocaPlant[loc], v.heading)
Freeze(CocaPlant[loc], true, v.heading)
exports['qb-target']:AddTargetEntity(CocaPlant[loc], { exports['qb-target']:AddTargetEntity(CocaPlant[loc], {
options = { { options = { {
icon = "fas fa-hand", icon = "fas fa-hand",
@@ -38,9 +39,10 @@ RegisterNetEvent("coke:init", function()
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not v.taken then if not v.taken then
CocaPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) CocaPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
SetEntityAsMissionEntity(CocaPlant[k], true, true) -- SetEntityAsMissionEntity(CocaPlant[k], true, true)
FreezeEntityPosition(CocaPlant[k], true) -- FreezeEntityPosition(CocaPlant[k], true)
SetEntityHeading(CocaPlant[k], v.heading) -- SetEntityHeading(CocaPlant[k], v.heading)
Freeze(CocaPlant[k], true, v.heading)
exports['qb-target']:AddTargetEntity(CocaPlant[k], { exports['qb-target']:AddTargetEntity(CocaPlant[k], {
options = { { options = { {
icon = "fas fa-hand", icon = "fas fa-hand",
+7 -9
View File
@@ -9,12 +9,11 @@ function Cornersell()
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0) TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
repeat repeat
Wait(1000) Wait(1000)
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0 until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
lib.requestAnimDict("rcmme_tracey1") lib.requestAnimDict("rcmme_tracey1")
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false) TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
FreezeEntityPosition(targ, true) FreezeEntityPosition(targ, true)
QBCore.Functions.TriggerCallback('md-drugs:server:cornerselling:getAvailableDrugs', function(item, amount) local item, amount = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false)
if item == 'nothing' then Notify(' You Aint Got Shit', 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end if item == 'nothing' then Notify(' You Aint Got Shit', 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end
local bagAmount = math.random(1, amount) local bagAmount = math.random(1, amount)
if bagAmount > 15 then bagAmount = math.random(1,15) end if bagAmount > 15 then bagAmount = math.random(1,15) end
@@ -22,7 +21,7 @@ function Cornersell()
local price = math.random(table['min'], table['max'] ) * bagAmount local price = math.random(table['min'], table['max'] ) * bagAmount
local targbusy = false local targbusy = false
local options = { local options = {
{ label = 'Sell ' .. bagAmount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' For $' .. price .. '!', icon = "fas fa-eye", { label = 'Sell ' .. bagAmount .. ' Of ' .. GetLabel(item) .. ' For $' .. price .. '!', icon = "fas fa-eye",
onSelect = function() onSelect = function()
PoliceCall(20) PoliceCall(20)
targbusy = true targbusy = true
@@ -36,7 +35,7 @@ function Cornersell()
sold = true sold = true
sell = false sell = false
return end return end
if not progressbar('Selling ' .. QBCore.Shared.Items[item].label .. '!', 4000, 'uncuff') then return end if not progressbar('Selling ' .. GetLabel(item) .. '!', 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, bagAmount, price) TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, bagAmount, price)
FreezeEntityPosition(targ, false) FreezeEntityPosition(targ, false)
ClearPedTasks(targ) ClearPedTasks(targ)
@@ -68,7 +67,7 @@ function Cornersell()
}, },
} }
local optionsqb = { local optionsqb = {
{ label = 'Sell ' .. bagAmount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' For $' .. price .. '!', icon = "fas fa-eye", { label = 'Sell ' .. bagAmount .. ' Of ' .. GetLabel(item) .. ' For $' .. price .. '!', icon = "fas fa-eye",
action = function() action = function()
PoliceCall(20) PoliceCall(20)
targbusy = true targbusy = true
@@ -82,7 +81,7 @@ function Cornersell()
sold = true sold = true
sell = false sell = false
return end return end
if not progressbar('Selling ' .. QBCore.Shared.Items[item].label .. '!', 4000, 'uncuff') then return end if not progressbar('Selling ' .. GetLabel(item) .. '!', 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, bagAmount, price) TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, bagAmount, price)
FreezeEntityPosition(targ, false) FreezeEntityPosition(targ, false)
ClearPedTasks(targ) ClearPedTasks(targ)
@@ -118,7 +117,6 @@ function Cornersell()
else else
exports['qb-target']:AddTargetEntity(targ, { options = optionsqb, distance = 2.0}) exports['qb-target']:AddTargetEntity(targ, { options = optionsqb, distance = 2.0})
end end
end)
repeat repeat
Wait(1000) Wait(1000)
until sold until sold
@@ -127,7 +125,7 @@ end
RegisterNetEvent('md-drugs:client:cornerselling', function() RegisterNetEvent('md-drugs:client:cornerselling', function()
if not GetCops(QBConfig.MinimumDrugSalePolice) then return end if not GetCops(QBConfig.MinimumDrugSalePolice) then return end
QBCore.Functions.TriggerCallback('md-drugs:server:cornerselling:getAvailableDrugs', function(item, amount) local item, amount = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false)
if item ~= 'nothing' then if item ~= 'nothing' then
if sell then if sell then
Notify('Lazy Ass Cant Even Sell Drugs', 'error') Notify('Lazy Ass Cant Even Sell Drugs', 'error')
@@ -143,5 +141,5 @@ RegisterNetEvent('md-drugs:client:cornerselling', function()
else else
Notify('You Cant Sell Air', 'error') Notify('You Cant Sell Air', 'error')
end end
end)
end) end)
+4 -5
View File
@@ -205,8 +205,9 @@ function InitZones()
end end
testdealer = CreatePed(0, Ped,v.coords.x,v.coords.y,v.coords.z-1, 90.0, false, false) testdealer = CreatePed(0, Ped,v.coords.x,v.coords.y,v.coords.z-1, 90.0, false, false)
FreezeEntityPosition(testdealer, true) -- FreezeEntityPosition(testdealer, true)
SetEntityInvincible(testdealer, true) -- SetEntityInvincible(testdealer, true)
Freeze(testdealer, true, 90)
exports["qb-target"]:AddBoxZone("dealer_"..k, vector3(v.coords.x, v.coords.y, v.coords.z), 1.5, 1.5, { exports["qb-target"]:AddBoxZone("dealer_"..k, vector3(v.coords.x, v.coords.y, v.coords.z), 1.5, 1.5, {
name = "dealer_"..k, name = "dealer_"..k,
heading = v.heading, heading = v.heading,
@@ -310,9 +311,7 @@ RegisterNetEvent('md-drugs:client:setLocation', function(locationData)
end end
Buyer = CreatePed(0, Ped,activeDelivery["coords"].x, activeDelivery["coords"].y, activeDelivery["coords"].z-1, 180.0, false, false) Buyer = CreatePed(0, Ped,activeDelivery["coords"].x, activeDelivery["coords"].y, activeDelivery["coords"].z-1, 180.0, false, false)
FreezeEntityPosition(Buyer, true) Freeze(Buyer, true, 180)
SetEntityInvincible(Buyer, true)
exports['qb-target']:AddTargetEntity(Buyer, { exports['qb-target']:AddTargetEntity(Buyer, {
options = { options = {
{ {
+16 -12
View File
@@ -89,10 +89,14 @@ end
function GetImage(img) function GetImage(img)
if GetResourceState('ox_inventory') == 'started' then if GetResourceState('ox_inventory') == 'started' then
local Items = exports['ox_inventory']:Items() local Items = exports['ox_inventory']:Items()
if Items[img]['client']['image'] == nil then if Items[img]['client'] then
return Items[img] if Items[img]['client']['image'] then
return Items[img]['client']['image']
else
return "nui://ox_inventory/web/images/".. img.. '.png'
end
else else
return Items[img]['client']['image'] return "nui://ox_inventory/web/images/".. img.. '.png'
end end
elseif GetResourceState('ps-inventory') == 'started' then elseif GetResourceState('ps-inventory') == 'started' then
return "nui://ps-inventory/html/images/".. QBCore.Shared.Items[img].image return "nui://ps-inventory/html/images/".. QBCore.Shared.Items[img].image
@@ -197,15 +201,15 @@ end
function GetCops(number) function GetCops(number)
if number == 0 then return true end if number == 0 then return true end
local need = false local amount = lib.callback.await('md-drugs:server:GetCoppers', false)
local nope = false if amount >= number then return true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
QBCore.Functions.TriggerCallback('md-drugs:server:GetCoppers', function(amount)
if amount >= number then need = true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') nope = true end
end)
repeat
Wait(100)
until need or nope
if need then return true end
end end
function Freeze(entity, toggle, head)
SetEntityInvincible(entity, toggle)
SetEntityAsMissionEntity(entity, toggle, toggle)
FreezeEntityPosition(entity, toggle)
SetEntityHeading(entity, head)
SetBlockingOfNonTemporaryEvents(entity, toggle)
end
+11 -8
View File
@@ -16,8 +16,9 @@ local Ped = "g_m_y_famdnf_01"
lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime)
local labkitlocation = Config.buyheroinlabkit local labkitlocation = Config.buyheroinlabkit
local heroinkitdealer = CreatePed(0, Ped, labkitlocation.x, labkitlocation.y, labkitlocation.z-1, labkitlocation.w, false, false) local heroinkitdealer = CreatePed(0, Ped, labkitlocation.x, labkitlocation.y, labkitlocation.z-1, labkitlocation.w, false, false)
FreezeEntityPosition(heroinkitdealer, true) -- FreezeEntityPosition(heroinkitdealer, true)
SetEntityInvincible(heroinkitdealer, true) -- SetEntityInvincible(heroinkitdealer, true)
Freeze(heroinkitdealer, true, labkitlocation.w)
local options = { local options = {
{ label = "Buy Heroin Lab Kit", icon = "fas fa-eye", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, { label = "Buy Heroin Lab Kit", icon = "fas fa-eye", event = "md-drugs:client:buyheroinlabkit", distance = 2.0},
} }
@@ -35,9 +36,10 @@ RegisterNetEvent('heroin:respawnCane', function(loc)
--if not HasModelLoaded(hash) then LoadModel(hash) end --if not HasModelLoaded(hash) then LoadModel(hash) end
if not PoppyPlants[loc] then if not PoppyPlants[loc] then
PoppyPlants[loc] = CreateObject(hash, v.location, false, true, true) PoppyPlants[loc] = CreateObject(hash, v.location, false, true, true)
SetEntityAsMissionEntity(PoppyPlants[loc], true, true) -- SetEntityAsMissionEntity(PoppyPlants[loc], true, true)
FreezeEntityPosition(PoppyPlants[loc], true) -- FreezeEntityPosition(PoppyPlants[loc], true)
SetEntityHeading(PoppyPlants[loc], v.heading) -- SetEntityHeading(PoppyPlants[loc], v.heading)
Freeze(PoppyPlants[loc], true, v.heading)
exports['qb-target']:AddTargetEntity(PoppyPlants[loc], { exports['qb-target']:AddTargetEntity(PoppyPlants[loc], {
options = { { options = { {
icon = "fas fa-hand", icon = "fas fa-hand",
@@ -68,9 +70,10 @@ RegisterNetEvent("heroin:init", function()
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not v.taken then if not v.taken then
PoppyPlants[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) PoppyPlants[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
SetEntityAsMissionEntity(PoppyPlants[k], true, true) -- SetEntityAsMissionEntity(PoppyPlants[k], true, true)
FreezeEntityPosition(PoppyPlants[k], true) -- FreezeEntityPosition(PoppyPlants[k], true)
SetEntityHeading(PoppyPlants[k], v.heading) -- SetEntityHeading(PoppyPlants[k], v.heading)
Freeze(PoppyPlants[k], true, v.heading)
exports['qb-target']:AddTargetEntity(PoppyPlants[k], { exports['qb-target']:AddTargetEntity(PoppyPlants[k], {
options = { { options = { {
icon = "fas fa-hand", icon = "fas fa-hand",
+3 -2
View File
@@ -4,8 +4,9 @@ CreateThread(function()
local current = "s_m_m_doctor_01" local current = "s_m_m_doctor_01"
lib.requestModel(current, Config.RequestModelTime) lib.requestModel(current, Config.RequestModelTime)
local SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, Config.SyrupVendor.w, false, false) local SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, Config.SyrupVendor.w, false, false)
FreezeEntityPosition(SyrupLocation, true) --FreezeEntityPosition(SyrupLocation, true)
SetEntityInvincible(SyrupLocation, true) -- SetEntityInvincible(SyrupLocation, true)
Freeze(SyrupLocation, true, Config.SyrupVendor.w)
local options = { local options = {
{ type = "client", label = "Get Task", icon = "fas fa-eye", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, { type = "client", label = "Get Task", icon = "fas fa-eye", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0},
} }
+3 -2
View File
@@ -16,8 +16,9 @@ CreateThread(function()
local Ped = "g_m_y_famdnf_01" local Ped = "g_m_y_famdnf_01"
lib.requestModel(Ped, Config.RequestModelTime) lib.requestModel(Ped, Config.RequestModelTime)
local tabdealer = CreatePed(0, Ped,Config.buylsdlabkit.x,Config.buylsdlabkit.y,Config.buylsdlabkit.z-1, Config.buylsdlabkit.w, false, false) local tabdealer = CreatePed(0, Ped,Config.buylsdlabkit.x,Config.buylsdlabkit.y,Config.buylsdlabkit.z-1, Config.buylsdlabkit.w, false, false)
FreezeEntityPosition(tabdealer, true) -- FreezeEntityPosition(tabdealer, true)
SetEntityInvincible(tabdealer, true) -- SetEntityInvincible(tabdealer, true)
Freeze(tabdealer, true, Config.buylsdlabkit.w)
local options = { local options = {
{ type = "client", label = "Buy LSD Lab Kit", icon = "fas fa-eye", event = "md-drugs:client:buylabkit", distance = 2.0} { type = "client", label = "Buy LSD Lab Kit", icon = "fas fa-eye", event = "md-drugs:client:buylabkit", distance = 2.0}
} }
+8 -6
View File
@@ -14,9 +14,10 @@ RegisterNetEvent('Mescaline:respawnCane', function(loc)
local hash = GetHashKey(v.model) local hash = GetHashKey(v.model)
if not Mescaline[loc] then if not Mescaline[loc] then
Mescaline[loc] = CreateObject(hash, v.location, false, true, true) Mescaline[loc] = CreateObject(hash, v.location, false, true, true)
SetEntityAsMissionEntity(Mescaline[loc], true, true) --SetEntityAsMissionEntity(Mescaline[loc], true, true)
FreezeEntityPosition(Mescaline[loc], true) --FreezeEntityPosition(Mescaline[loc], true)
SetEntityHeading(Mescaline[loc], v.heading) --SetEntityHeading(Mescaline[loc], v.heading)
Freeze(Mescaline[loc], true, v.heading)
exports['qb-target']:AddTargetEntity(Mescaline[loc], { exports['qb-target']:AddTargetEntity(Mescaline[loc], {
options = { options = {
{icon = "fas fa-hand",label = "pick Cactus",action = function() if not progressbar(Lang.mescaline.pick, 4000, 'uncuff') then return end TriggerServerEvent("Mescaline:pickupCane", loc)end} {icon = "fas fa-hand",label = "pick Cactus",action = function() if not progressbar(Lang.mescaline.pick, 4000, 'uncuff') then return end TriggerServerEvent("Mescaline:pickupCane", loc)end}
@@ -41,9 +42,10 @@ RegisterNetEvent("Mescaline:init", function()
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not v.taken then if not v.taken then
Mescaline[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) Mescaline[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
SetEntityAsMissionEntity(Mescaline[k], true, true) --SetEntityAsMissionEntity(Mescaline[k], true, true)
FreezeEntityPosition(Mescaline[k], true) --FreezeEntityPosition(Mescaline[k], true)
SetEntityHeading(Mescaline[k], v.heading) --SetEntityHeading(Mescaline[k], v.heading)
Freeze(Mescaline[k], true, v.heading)
exports['qb-target']:AddTargetEntity(Mescaline[k], { exports['qb-target']:AddTargetEntity(Mescaline[k], {
options = { { icon = "fas fa-hand", label = "Pick Mescaline", action = function() if not progressbar(Lang.mescaline.pick, 4000, 'uncuff') then return end TriggerServerEvent("Mescaline:pickupCane", k) end} options = { { icon = "fas fa-hand", label = "Pick Mescaline", action = function() if not progressbar(Lang.mescaline.pick, 4000, 'uncuff') then return end TriggerServerEvent("Mescaline:pickupCane", k) end}
}, },
+4 -3
View File
@@ -197,9 +197,10 @@ else
lib.requestModel(current, Config.RequestModelTime) lib.requestModel(current, Config.RequestModelTime)
local CurrentLocation = Config.MethHeistStart local CurrentLocation = Config.MethHeistStart
local methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false) local methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false)
FreezeEntityPosition(methdealer, true) --FreezeEntityPosition(methdealer, true)
SetEntityHeading(methdealer, 220.0) --SetEntityHeading(methdealer, 220.0)
SetEntityInvincible(methdealer, true) --SetEntityInvincible(methdealer, true)
Freeze(methdealer, true, 220.0)
exports['qb-target']:AddTargetEntity(methdealer, { exports['qb-target']:AddTargetEntity(methdealer, {
options = { options = {
{ {
+4 -3
View File
@@ -55,9 +55,10 @@ RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
local current = "g_m_y_famdnf_01" local current = "g_m_y_famdnf_01"
lib.requestModel(current, Config.RequestModelTime) lib.requestModel(current, Config.RequestModelTime)
local oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) local oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
SetEntityHeading(oxybuyer, 180) --SetEntityHeading(oxybuyer, 180)
FreezeEntityPosition(oxybuyer, true) --FreezeEntityPosition(oxybuyer, true)
SetEntityInvincible(oxybuyer, true) --SetEntityInvincible(oxybuyer, true)
Freeze(oxybuyer, true, CurrentLocation.w)
repeat repeat
Wait(1000) Wait(1000)
until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x,CurrentLocation.y,CurrentLocation.z)) < 5.0 until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x,CurrentLocation.y,CurrentLocation.z)) < 5.0
+8 -6
View File
@@ -16,9 +16,10 @@ RegisterNetEvent('shrooms:respawnCane', function(loc)
--if not HasModelLoaded(hash) then LoadModel(hash) end --if not HasModelLoaded(hash) then LoadModel(hash) end
if not shrooms[loc] then if not shrooms[loc] then
shrooms[loc] = CreateObject(hash, v.location, false, true, true) shrooms[loc] = CreateObject(hash, v.location, false, true, true)
SetEntityAsMissionEntity(shrooms[loc], true, true) -- SetEntityAsMissionEntity(shrooms[loc], true, true)
FreezeEntityPosition(shrooms[loc], true) -- FreezeEntityPosition(shrooms[loc], true)
SetEntityHeading(shrooms[loc], v.heading) -- SetEntityHeading(shrooms[loc], v.heading)
Freeze(shrooms[loc], true, v.heading)
exports['qb-target']:AddTargetEntity(shrooms[loc], { exports['qb-target']:AddTargetEntity(shrooms[loc], {
options = { { icon = "fas fa-hand", label = "pick shrooms", action = function() if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end TriggerServerEvent("shrooms:pickupCane", loc) end } options = { { icon = "fas fa-hand", label = "pick shrooms", action = function() if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end TriggerServerEvent("shrooms:pickupCane", loc) end }
}, },
@@ -63,9 +64,10 @@ end)
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not v.taken then if not v.taken then
shrooms[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true) shrooms[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
SetEntityAsMissionEntity(shrooms[k], true, true) --SetEntityAsMissionEntity(shrooms[k], true, true)
FreezeEntityPosition(shrooms[k], true) --FreezeEntityPosition(shrooms[k], true)
SetEntityHeading(shrooms[k], v.heading) --SetEntityHeading(shrooms[k], v.heading)
Freeze(shrooms[k], true, v.heading)
exports['qb-target']:AddTargetEntity(shrooms[k], { exports['qb-target']:AddTargetEntity(shrooms[k], {
options = { { icon = "fas fa-hand", label = "Pick shrooms", action = function() if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end TriggerServerEvent("shrooms:pickupCane", k) end } options = { { icon = "fas fa-hand", label = "Pick shrooms", action = function() if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end TriggerServerEvent("shrooms:pickupCane", k) end }
}, },
+3 -2
View File
@@ -5,8 +5,9 @@ local current = "g_m_y_famdnf_01"
lib.requestModel(current, Config.RequestModelTime) lib.requestModel(current, Config.RequestModelTime)
local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)] local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)]
local travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) local travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
FreezeEntityPosition(travellingmerchant, true) --FreezeEntityPosition(travellingmerchant, true)
SetEntityInvincible(travellingmerchant, true) --SetEntityInvincible(travellingmerchant, true)
Freeze(travellingmerchant, true, CurrentLocation.w)
if Config.oxtarget then if Config.oxtarget then
local options = { local options = {
{ label = "Travelling Merchant", icon = "fas fa-eye", onSelect = function() lib.showContext('travellingmerchant') end}, { label = "Travelling Merchant", icon = "fas fa-eye", onSelect = function() lib.showContext('travellingmerchant') end},
+11 -8
View File
@@ -16,9 +16,10 @@ RegisterNetEvent('weed:respawnCane', function(loc)
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not WeedPlant[loc] then if not WeedPlant[loc] then
WeedPlant[loc] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true) WeedPlant[loc] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true)
SetEntityAsMissionEntity(WeedPlant[loc], true, true) --SetEntityAsMissionEntity(WeedPlant[loc], true, true)
FreezeEntityPosition(WeedPlant[loc], true) --FreezeEntityPosition(WeedPlant[loc], true)
SetEntityHeading(WeedPlant[loc], v.heading) --SetEntityHeading(WeedPlant[loc], v.heading)
Freeze(WeedPlant[loc],true, v.heading)
exports['qb-target']:AddTargetEntity(WeedPlant[loc], { exports['qb-target']:AddTargetEntity(WeedPlant[loc], {
options = { options = {
{ {
@@ -51,9 +52,10 @@ RegisterNetEvent("weed:init", function()
if not HasModelLoaded(hash) then LoadModel(hash) end if not HasModelLoaded(hash) then LoadModel(hash) end
if not v.taken then if not v.taken then
WeedPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true) WeedPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true)
SetEntityAsMissionEntity(WeedPlant[k], true, true) --SetEntityAsMissionEntity(WeedPlant[k], true, true)
FreezeEntityPosition(WeedPlant[k], true) --FreezeEntityPosition(WeedPlant[k], true)
SetEntityHeading(WeedPlant[k], v.heading) --SetEntityHeading(WeedPlant[k], v.heading)
Freeze(WeedPlant[k],true, v.heading)
exports['qb-target']:AddTargetEntity(WeedPlant[k], { exports['qb-target']:AddTargetEntity(WeedPlant[k], {
options = { options = {
{ {
@@ -390,8 +392,9 @@ local current = "u_m_m_jesus_01"
lib.requestModel(current, Config.RequestModelTime) lib.requestModel(current, Config.RequestModelTime)
local CurrentLocation = Config.WeedSaleman local CurrentLocation = Config.WeedSaleman
local WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false) local WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
FreezeEntityPosition(WeedGuy, true) --FreezeEntityPosition(WeedGuy, true)
SetEntityInvincible(WeedGuy, true) --SetEntityInvincible(WeedGuy, true)
Freeze(WeedGuy, true, CurrentLocation.w)
exports['qb-target']:AddTargetEntity(WeedGuy, { exports['qb-target']:AddTargetEntity(WeedGuy, {
options = { options = {
{label = "Weed Shop",icon = "fas fa-eye",action = function() lib.showContext('WeedShop')end}, {label = "Weed Shop",icon = "fas fa-eye",action = function() lib.showContext('WeedShop')end},
+3 -4
View File
@@ -3,7 +3,7 @@ local StolenDrugs = {}
QBCore.Functions.CreateCallback('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb) lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb)
local AvailableDrugs = {} local AvailableDrugs = {}
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
if not Player then return nil end if not Player then return nil end
@@ -12,12 +12,11 @@ QBCore.Functions.CreateCallback('md-drugs:server:cornerselling:getAvailableDrugs
local item = Player.Functions.GetItemByName(k) local item = Player.Functions.GetItemByName(k)
if item and type == 0 then if item and type == 0 then
type = type + 1 type = type + 1
cb(item.name, item.amount) return item.name, item.amount
end end
end end
if type == 0 then if type == 0 then
print(type) return 'nothing', 0
cb('nothing', 0)
end end
end) end)
+31 -2
View File
@@ -13,6 +13,18 @@ function Notifys(text, type)
end end
end end
function checkTable(player, table)
local need = 0
local have = 0
for k, v in pairs (table) do
need = need + 1
if Itemcheck(player, k, v, 'true') then have = have + 1 end
end
if need == have then
return true
else
end
end
function Itemcheck(Player, item, amount, notify) function Itemcheck(Player, item, amount, notify)
local itemchecks = Player.Functions.GetItemByName(item) local itemchecks = Player.Functions.GetItemByName(item)
local yes local yes
@@ -53,7 +65,18 @@ function AddItem(item, amount)
end end
end end
QBCore.Functions.CreateCallback('md-drugs:server:GetCoppers', function(source, cb, args) --QBCore.Functions.CreateCallback('md-drugs:server:GetCoppers', function(source, cb, args)
-- local amount = 0
-- local players = QBCore.Functions.GetQBPlayers()
-- for k, v in pairs(players) do
-- if v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then
-- amount = amount + 1
-- end
-- end
-- cb(amount)
--end)
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
local amount = 0 local amount = 0
local players = QBCore.Functions.GetQBPlayers() local players = QBCore.Functions.GetQBPlayers()
for k, v in pairs(players) do for k, v in pairs(players) do
@@ -61,9 +84,15 @@ QBCore.Functions.CreateCallback('md-drugs:server:GetCoppers', function(source, c
amount = amount + 1 amount = amount + 1
end end
end end
cb(amount) return amount
end) end)
lib.addCommand('cornersell', {
help = 'Start/Stop Cornerselling',
restricted = 'group.admin'
}, function(source, args, raw)
TriggerClientEvent('md-drugs:client:cornerselling',source)
end)
CreateThread(function() CreateThread(function()
if not GetResourceState('ox_lib'):find("start") then if not GetResourceState('ox_lib'):find("start") then
+1 -1
View File
@@ -179,7 +179,7 @@ Config.Items = { --- this is the store for the travelling merchant
[4] = {name = "mdp2p", price = 25, amount = 50, }, [4] = {name = "mdp2p", price = 25, amount = 50, },
[5] = {name = "lysergic_acid", price = 25, amount = 50, }, [5] = {name = "lysergic_acid", price = 25, amount = 50, },
[6] = {name = "diethylamide", price = 25, amount = 50, }, [6] = {name = "diethylamide", price = 25, amount = 50, },
[7] = {name = "empty_weed_bag", price = 2, amount = 1000, }, [7] = {name = "lockpick", price = 2, amount = 1000, },
[8] = {name = "emptyvial", price = 2, amount = 1000, }, [8] = {name = "emptyvial", price = 2, amount = 1000, },
[9] = {name = "needle", price = 2, amount = 1000, }, [9] = {name = "needle", price = 2, amount = 1000, },
[10] = {name = "cokeburner", price = 25, amount = 50, }, [10] = {name = "cokeburner", price = 25, amount = 50, },