refractored a lot removed travellingmerchant file, now in pedspawns.lua

This commit is contained in:
Mustache Dom committed 2024-11-24 01:25:09 -08:00
1 parent 001378704c
commit 5b6fef2d49
17 files changed
+112 -172

No files matched your search

+10 -30
View File
@@ -11,8 +11,6 @@ local started = nil
SetPtfxAssetNextCall(dict) SetPtfxAssetNextCall(dict)
end end
function MethCooking() function MethCooking()
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker" local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
lib.requestAnimDict(animDict, 500) lib.requestAnimDict(animDict, 500)
@@ -162,8 +160,6 @@ function Tray()
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01,-0.2, -0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true) AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01,-0.2, -0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
end end
function CutCoke() function CutCoke()
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter" local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
lib.requestAnimDict(animDict, 500) lib.requestAnimDict(animDict, 500)
@@ -382,9 +378,9 @@ function SpawnCarPedChase()
lib.requestModel(`pounder`, Config.RequestModelTime) lib.requestModel(`pounder`, Config.RequestModelTime)
lib.requestModel("ig_priest", Config.RequestModelTime) lib.requestModel("ig_priest", Config.RequestModelTime)
lib.requestModel(`cargobob3`, Config.RequestModelTime) lib.requestModel(`cargobob3`, Config.RequestModelTime)
local leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, true, true) local leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, false, false)
local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, true, false) local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false)
local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
FreezeEntityPosition(pilot2, true) FreezeEntityPosition(pilot2, true)
SetEntityInvincible(pilot2, true) SetEntityInvincible(pilot2, true)
SetEntityAsMissionEntity(leancar) SetEntityAsMissionEntity(leancar)
@@ -416,7 +412,7 @@ function SpawnCarPedChase()
Wait(1000) Wait(1000)
until #(GetEntityCoords(driver) - GetEntityCoords(pilot2)) < 25.0 until #(GetEntityCoords(driver) - GetEntityCoords(pilot2)) < 25.0
Wait( 3 * 1000) Wait( 3 * 1000)
local heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) local heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false)
Wait(1000) Wait(1000)
if DoesEntityExist(heli) then if DoesEntityExist(heli) then
SetEntityInvincible(pilot2, false) SetEntityInvincible(pilot2, false)
@@ -426,7 +422,7 @@ function SpawnCarPedChase()
SetPedIntoVehicle(pilot2, heli, -1) SetPedIntoVehicle(pilot2, heli, -1)
TaskHeliMission(pilot2, heli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) TaskHeliMission(pilot2, heli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0)
else else
heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) heli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false)
end end
end end
end end
@@ -446,9 +442,9 @@ else
lib.requestModel(`journey`, Config.RequestModelTime) lib.requestModel(`journey`, Config.RequestModelTime)
lib.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime) lib.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime)
lib.requestModel(`cargobob3`, Config.RequestModelTime) lib.requestModel(`cargobob3`, Config.RequestModelTime)
local methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, true, true) local methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, false, false)
local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, true, false) local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false)
local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
FreezeEntityPosition(methpilot, true) FreezeEntityPosition(methpilot, true)
SetEntityInvincible(methpilot, true) SetEntityInvincible(methpilot, true)
SetEntityAsMissionEntity(methcar) SetEntityAsMissionEntity(methcar)
@@ -481,7 +477,7 @@ else
Wait(1000) Wait(1000)
until #(GetEntityCoords(methdriver) - GetEntityCoords(methpilot)) < 25.0 until #(GetEntityCoords(methdriver) - GetEntityCoords(methpilot)) < 25.0
Wait( 3 * 1000) Wait( 3 * 1000)
local methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) local methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false)
Wait(1000) Wait(1000)
if DoesEntityExist(methheli) then if DoesEntityExist(methheli) then
SetEntityInvincible(methpilot, false) SetEntityInvincible(methpilot, false)
@@ -492,7 +488,7 @@ else
SetPedIntoVehicle(methpilot, methheli, -1) SetPedIntoVehicle(methpilot, methheli, -1)
TaskHeliMission(methpilot, methheli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0) TaskHeliMission(methpilot, methheli, 0, 0, -3362.05, 589.45, -13.04, 4, 150.0, 20.0, -1.0, 10, 10, 5.0, 0)
else else
methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, true,true) methheli = CreateVehicle(`cargobob3`, stoploc.x-20, stoploc.y-20, stoploc.z-1, 80, false,false)
end end
end end
end end
@@ -520,19 +516,3 @@ function SetUpPeds()
end end
end end
RegisterCommand('DrugRep', function()
if not Config.TierSystem then return end
local rep = lib.callback.await('md-drugs:server:GetRep', false)
lib.registerContext({
id = 'DrugRep',
title = 'Drug Reputation',
options = {
{icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke},
{icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin},
{icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd},
{icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
{icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
}
})
lib.showContext('DrugRep')
end, false)
+1
View File
@@ -1,6 +1,7 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
local isActive = false local isActive = false
local dealer = {} local dealer = {}
RegisterNetEvent('md-drugs:client:opendealermenu', function() RegisterNetEvent('md-drugs:client:opendealermenu', function()
local rep = GetRep() local rep = GetRep()
makeMenu('dealermenu', rep) makeMenu('dealermenu', rep)
+20 -12
View File
@@ -624,15 +624,6 @@ AddEventHandler('onResourceStart', function(resource)
LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b') LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b')
end end
end) end)
local active = false
RegisterNetEvent('md-drugs:client:minusTier', function(data)
if active then return end
if not data then return end
active = true
if not progressbar('Cutting This ' ..GetLabel(data.item) .. ' More', 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:AddMas', data)
active = false
end)
CreateThread(function() CreateThread(function()
TriggerEvent('heroin:init') TriggerEvent('heroin:init')
@@ -642,7 +633,24 @@ CreateThread(function()
TriggerEvent('weed:init') TriggerEvent('weed:init')
end) end)
lib.callback.register('md-drugs:client:uncuff', function() lib.callback.register('md-drugs:client:uncuff', function(data)
if not progressbar('Uncuffing', 4000, 'uncuff') then return end if not progressbar(data, 4000, 'uncuff') then return end
return true return true
end) end)
RegisterCommand('DrugRep', function()
if not Config.TierSystem then return end
local rep = lib.callback.await('md-drugs:server:GetRep', false)
lib.registerContext({
id = 'DrugRep',
title = 'Drug Reputation',
options = {
{icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke},
{icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin},
{icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd},
{icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
{icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
}
})
lib.showContext('DrugRep')
end, false)
-1
View File
@@ -104,7 +104,6 @@ RegisterNetEvent("md-drugs:client:heatliquidheroin", function(data)
TriggerServerEvent("md-drugs:server:heatliquidheroin") TriggerServerEvent("md-drugs:server:heatliquidheroin")
end) end)
RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data) RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data)
if not ItemCheck('cleaningkit') then return end if not ItemCheck('cleaningkit') then return end
if not progressbar(Lang.Heroin.clean, 4000, 'clean') then return end if not progressbar(Lang.Heroin.clean, 4000, 'clean') then return end
+2 -2
View File
@@ -1,8 +1,8 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function() RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function()
Notify(Lang.Lean.marked, "success") Notify(Lang.Lean.marked, "success")
SpawnCarPedChase() SpawnCarPedChase()
end) end)
RegisterNetEvent('md-drugs:client:leancraft', function() RegisterNetEvent('md-drugs:client:leancraft', function()
-1
View File
@@ -1,7 +1,6 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
local tableout = false local tableout = false
local function createLabKit(coord, head) local function createLabKit(coord, head)
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false) local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
SetEntityHeading(labkit, head) SetEntityHeading(labkit, head)
+2 -3
View File
@@ -3,6 +3,7 @@ local amonia = nil
local tray = nil local tray = nil
local heated = nil local heated = nil
local active = nil local active = nil
local function startcook() local function startcook()
if not ItemCheck('empty_weed_bag') then return end if not ItemCheck('empty_weed_bag') then return end
if not ItemCheck('acetone') then return end if not ItemCheck('acetone') then return end
@@ -123,6 +124,4 @@ end)
RegisterNetEvent("md-drugs:client:stealace", function(data) RegisterNetEvent("md-drugs:client:stealace", function(data)
if not progressbar('Stealing Acetone', 4000, 'uncuff') then return end if not progressbar('Stealing Acetone', 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getace", data.data) TriggerServerEvent("md-drugs:server:getace", data.data)
end) end)
+13 -21
View File
@@ -5,8 +5,9 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function()
lib.requestModel("burrito3", Config.RequestModelTime) lib.requestModel("burrito3", Config.RequestModelTime)
local paid = lib.callback.await('md-drugs:server:payfortruck', false) local paid = lib.callback.await('md-drugs:server:payfortruck', false)
if not paid then return end if not paid then return end
local loc = lib.callback.await('md-drugs:server:getLocs', false) local loca = lib.callback.await('md-drugs:server:getLocs', false)
local oxycar = CreateVehicle("burrito3",loc.singleSpot.truckspawn.x, loc.singleSpot.truckspawn.y,loc.singleSpot.truckspawn.z, loc.singleSpot.truckspawn.w, true, false) local loc = loca.singleSpot.truckspawn
local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false)
exports[Config.Fuel]:SetFuel(oxycar, 100.0) exports[Config.Fuel]:SetFuel(oxycar, 100.0)
TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar)) TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(oxycar))
Notify(Lang.oxy.truck, 'success') Notify(Lang.oxy.truck, 'success')
@@ -14,21 +15,18 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function()
AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fas fa-box-circle-check", label = Lang.targets.oxy.pack}, nil ) AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fas fa-box-circle-check", label = Lang.targets.oxy.pack}, nil )
end) end)
RegisterNetEvent("md-drugs:client:getoxylocationroute", function() RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = lib.callback.await('md-drugs:server:getLocs', false)
local CurrentLocation = config.oxylocations[math.random(#config.oxylocations)] local loc = config.oxylocations[math.random(#config.oxylocations)]
if CurrentLocation ~= nil then if loc ~= nil then
SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) SetNewWaypoint(loc.x, loc.y)
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,loc.x,loc.y,loc.z-1, loc.w, false, false)
Freeze(oxybuyer, true, CurrentLocation.w) Freeze(oxybuyer, true, loc.w)
repeat repeat
Wait(1000) Wait(1000)
until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x,CurrentLocation.y,CurrentLocation.z)) < 5.0 until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x,loc.y,loc.z)) < 5.0
PoliceCall(Config.PoliceAlertOxy) PoliceCall(Config.PoliceAlertOxy)
AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fas fa-eye", AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fas fa-eye",
action = function() action = function()
@@ -50,21 +48,15 @@ end)
RegisterNetEvent("md-drugs:client:getfromtrunk", function() RegisterNetEvent("md-drugs:client:getfromtrunk", function()
if carryPackage then if carryPackage then
Notify(Lang.oxy.cantcarry, "error") Notify(Lang.oxy.cantcarry, "error")
else else
local pos = GetEntityCoords(PlayerPedId(), true) local pos = GetEntityCoords(PlayerPedId(), true)
RequestAnimDict('anim@heists@box_carry@') lib.requestAnimDict('anim@heists@box_carry@')
while (not HasAnimDictLoaded('anim@heists@box_carry@')) do
Wait(7)
end
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false) TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
RequestModel("hei_prop_drug_statue_box_big") lib.RequestModel("hei_prop_drug_statue_box_big")
while not HasModelLoaded("hei_prop_drug_statue_box_big") do
Wait(0)
end
local object = CreateObject("hei_prop_drug_statue_box_big", pos.x, pos.y, pos.z, true, true, true) local object = CreateObject("hei_prop_drug_statue_box_big", pos.x, pos.y, pos.z, true, true, true)
AttachEntityToEntity(object, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true) AttachEntityToEntity(object, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true)
carryPackage = object carryPackage = object
end end
end) end)
+4 -1
View File
@@ -1,6 +1,7 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
CreateThread(function() CreateThread(function()
local config = lib.callback.await('md-drugs:server:getLocs', false) local config = lib.callback.await('md-drugs:server:getLocs', false)
local num = lib.callback.await('md-drugs:server:GetMerchant', false)
local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01', "prop_cooker_03"} local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01', "prop_cooker_03"}
for k, v in pairs (model) do for k, v in pairs (model) do
lib.requestModel(v, Config.RequestModelTime) lib.requestModel(v, Config.RequestModelTime)
@@ -10,15 +11,17 @@ CreateThread(function()
local SyrupLocation = CreatePed(0, 's_m_m_doctor_01', config.singleSpot.SyrupVendor.x,config.singleSpot.SyrupVendor.y,config.singleSpot.SyrupVendor.z-1, config.singleSpot.SyrupVendor.w, false, false) local SyrupLocation = CreatePed(0, 's_m_m_doctor_01', config.singleSpot.SyrupVendor.x,config.singleSpot.SyrupVendor.y,config.singleSpot.SyrupVendor.z-1, config.singleSpot.SyrupVendor.w, false, false)
local WeedGuy = CreatePed(0,'u_m_m_jesus_01',config.singleSpot.WeedSaleman.x,config.singleSpot.WeedSaleman.y,config.singleSpot.WeedSaleman.z-1, config.singleSpot.WeedSaleman.w, false, false) local WeedGuy = CreatePed(0,'u_m_m_jesus_01',config.singleSpot.WeedSaleman.x,config.singleSpot.WeedSaleman.y,config.singleSpot.WeedSaleman.z-1, config.singleSpot.WeedSaleman.w, false, false)
local methdealer = CreatePed(0, "g_m_y_famdnf_01", config.singleSpot.MethHeistStart.x, config.singleSpot.MethHeistStart.y, config.singleSpot.MethHeistStart.z - 1, false, false) local methdealer = CreatePed(0, "g_m_y_famdnf_01", config.singleSpot.MethHeistStart.x, config.singleSpot.MethHeistStart.y, config.singleSpot.MethHeistStart.z - 1, false, false)
local travellingmerchant = CreatePed(0, "g_m_y_famdnf_01",num.x,num.y,num.z-1, num.w, false, false)
Freeze(tabdealer, true,config.singleSpot.buylsdlabkit.w) Freeze(tabdealer, true,config.singleSpot.buylsdlabkit.w)
Freeze(SyrupLocation, true, config.singleSpot.SyrupVendor.w) Freeze(SyrupLocation, true, config.singleSpot.SyrupVendor.w)
Freeze(heroinkitdealer, true, config.singleSpot.buyheroinlabkit.w) Freeze(heroinkitdealer, true, config.singleSpot.buyheroinlabkit.w)
Freeze(WeedGuy, true, config.singleSpot.WeedSaleman.w) Freeze(WeedGuy, true, config.singleSpot.WeedSaleman.w)
Freeze(methdealer, true, 220.0) Freeze(methdealer, true, 220.0)
Freeze(travellingmerchant, true, num.w)
AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer ) AddSingleModel(tabdealer,{ type = "client", label = Lang.targets.lsd.buy, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buylabkit", distance = 2.0}, tabdealer )
AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil ) AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil )
AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil ) AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil )
AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil) AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fas fa-eye", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil)
AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil ) AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fas fa-eye", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil )
AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fas fa-eye", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil)
end) end)
-1
View File
@@ -9,7 +9,6 @@ local function LoadModels(hash)
Wait(10) Wait(10)
end end
if HasModelLoaded(hash) then return true end if HasModelLoaded(hash) then return true end
end end
local function pick(loc) local function pick(loc)
-14
View File
@@ -1,14 +0,0 @@
local QBCore = exports['qb-core']:GetCoreObject()
CreateThread(function()
local current = "g_m_y_famdnf_01"
lib.requestModel(current, Config.RequestModelTime)
local num = lib.callback.await('md-drugs:server:GetMerchant', false)
local travellingmerchant = CreatePed(0, current,num.x,num.y,num.z-1, num.w, false, false)
Freeze(travellingmerchant, true, num.w)
AddSingleModel(travellingmerchant, { label = Lang.targets.travel.travel, icon = "fas fa-eye",
action = function()
makeMenu('travellingMerchant')
lib.showContext('travellingMerchant')
end}, nil)
end)
+16 -29
View File
@@ -10,6 +10,11 @@ local function hasJob()
return true end return true end
end end
local function pick(loc)
if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end
TriggerServerEvent("weed:pickupCane", loc)
end
RegisterNetEvent('weed:respawnCane', function(loc) RegisterNetEvent('weed:respawnCane', function(loc)
local v = GlobalState.WeedPlant[loc] local v = GlobalState.WeedPlant[loc]
local hash = GetHashKey(v.model) local hash = GetHashKey(v.model)
@@ -17,10 +22,7 @@ RegisterNetEvent('weed:respawnCane', function(loc)
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)
Freeze(WeedPlant[loc],true, v.heading) Freeze(WeedPlant[loc],true, v.heading)
AddSingleModel(WeedPlant[loc], AddSingleModel(WeedPlant[loc], {icon = "fas fa-hand",label = Lang.targets.weed.pick, action = function() pick(loc) end}, loc)
{icon = "fas fa-hand",label = Lang.targets.weed.pick,
action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", loc) end},
loc)
end end
end) end)
@@ -36,10 +38,7 @@ RegisterNetEvent("weed:init", function()
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)
Freeze(WeedPlant[k],true, v.heading) Freeze(WeedPlant[k],true, v.heading)
AddSingleModel(WeedPlant[k], AddSingleModel(WeedPlant[k], {icon = "fas fa-hand",label = Lang.targets.weed.pick, action = function() pick(k) end}, k)
{icon = "fas fa-hand",label = Lang.targets.weed.pick,
action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", k) end},
k)
end end
end end
end) end)
@@ -101,30 +100,27 @@ AddBoxZoneSingle('MakeButterCrafting', config.singleSpot.MakeButter, {label = La
canInteract = function() if hasJob() then return true end end canInteract = function() if hasJob() then return true end end
}) })
AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, { AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, {
name = 'Oil', name = 'Oil',
icon = "fas fa-sign-in-alt", icon = "fas fa-sign-in-alt",
label = Lang.targets.weed.oil, label = Lang.targets.weed.oil,
action = function() action = function()
if not ItemCheckMulti({'butane', 'grindedweed'}) then return end if not ItemCheckMulti({'butane', 'grindedweed'}) then return end
if not minigame() then if not minigame() then
local explosion = math.random(1,100)
local loc = GetEntityCoords(PlayerPedId()) local loc = GetEntityCoords(PlayerPedId())
if explosion <= 99 then AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true)
AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true, true) exploded = true
exploded = true Notify(Lang.Weed.stovehot, "error")
Notify(Lang.Weed.stovehot, "error") Wait(1000 * 30)
Wait(1000 * 30) exploded = false
exploded = false
end
return end return end
if not progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end if not progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makeoil") TriggerServerEvent("md-drugs:server:makeoil")
end, end,
canInteract = function() canInteract = function()
if hasJob() and exploded == false then return true end if hasJob() and exploded == false then return true end
end, end,
} ) })
local stove = CreateObject("prop_cooker_03",config.singleSpot.MakeButter.x, config.singleSpot.MakeButter.y, config.singleSpot.MakeButter.z-1, true, false) local stove = CreateObject("prop_cooker_03",config.singleSpot.MakeButter.x, config.singleSpot.MakeButter.y, config.singleSpot.MakeButter.z-1, true, false)
SetEntityHeading(stove, 270.00) SetEntityHeading(stove, 270.00)
FreezeEntityPosition(stove, true) FreezeEntityPosition(stove, true)
@@ -145,15 +141,6 @@ CreateThread(function()
RefreshInterior(BikerWeedFarm.interiorId) RefreshInterior(BikerWeedFarm.interiorId)
end) end)
RegisterNetEvent("md-drugs:client:rollanim", function()
if not progressbar(Lang.Weed.roll, 4000, 'uncuff') then return end
end)
RegisterNetEvent("md-drugs:client:grind", function()
if not progressbar("grinding", 4000, 'uncuff') then return end
end)
RegisterNetEvent("md-drugs:client:dodabs", function() RegisterNetEvent("md-drugs:client:dodabs", function()
if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end
AlienEffect() AlienEffect()
+27 -36
View File
@@ -1,58 +1,49 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
local miss = false local miss = false
RegisterNetEvent("md-drugs:client:GetLocation", function(drug) RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
if not GetCops(Config.PoliceCount) then return end if not GetCops(Config.PoliceCount) then return end
if miss then if miss then
Notify(Lang.Wholesale.al, 'error') Notify(Lang.Wholesale.al, 'error')
else else
local CurrentLocation = drug.location local loc = drug.location
local timer = 0 local timer = 0
miss = true miss = true
SetNewWaypoint(CurrentLocation.x, CurrentLocation.y) SetNewWaypoint(loc.x, loc.y)
lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime)
local current = "g_m_y_famdnf_01" local current = "g_m_y_famdnf_01"
local drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false)
FreezeEntityPosition(drugdealer, true) FreezeEntityPosition(drugdealer, true)
SetEntityInvincible(drugdealer, true) SetEntityInvincible(drugdealer, true)
AddMultiModel(drugdealer, {{ AddMultiModel(drugdealer, {{
label = Lang.targets.Wholesale.talk, label = Lang.targets.Wholesale.talk,
icon = "fas fa-eye", icon = "fas fa-eye",
action = function() action = function()
local luck = math.random(1,100) local luck = math.random(1,100)
if luck <= Config.SuccessfulChance then if luck <= Config.SuccessfulChance then
TriggerEvent("md-drugs:client:SuccessSale", drug) if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end
else TriggerServerEvent("md-drugs:server:SuccessSale", drug)
TriggerEvent("md-drugs:client:SetUp", drug) else
end progressbar("YOU FUCKED NOW", 4000, 'uncuff')
Wait(3000) SetUpPeds()
DeleteEntity(drugdealer) end
miss = false Wait(3000)
end DeleteEntity(drugdealer)
}},drugdealer ) miss = false
end
}},drugdealer )
repeat repeat
Wait(1000) Wait(1000)
timer = timer + 1 timer = timer + 1
until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1 until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1
PoliceCall(Config.AlertPoliceWholesale) PoliceCall(Config.AlertPoliceWholesale)
if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 then if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then
timer = 0 timer = 0
else else
Notify('The Buyer Waited To Long') Notify('The Buyer Waited To Long', 'error')
DeleteEntity(drugdealer) DeleteEntity(drugdealer)
end end
end end
end) end)
RegisterNetEvent("md-drugs:client:SuccessSale", function(drug)
if not progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:SuccessSale", drug)
end)
RegisterNetEvent("md-drugs:client:SetUp", function(drug)
progressbar("YOU FUCKED NOW", 4000, 'uncuff')
TriggerServerEvent("md-drugs:server:SetUp", drug)
SetUpPeds()
end)
+9 -8
View File
@@ -52,15 +52,12 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source local src = source
if not checkLoc(src, 'MakePowder', num) then return end if not checkLoc(src, 'MakePowder', num) then return end
local tier = 'tier1' local tier = 'tier1'
local logMessage = ' Made Raw Coke'
if Config.TierSystem then if Config.TierSystem then
local coke = getRep(src, 'coke') local coke = getRep(src, 'coke')
if coke > Config.Tier1 and coke <= Config.Tier2 then if coke > Config.Tier1 and coke <= Config.Tier2 then
tier = 'tier2' tier = 'tier2'
logMessage = ' Made Raw Coke tier 2'
elseif coke > Config.Tier2 then elseif coke > Config.Tier2 then
tier = 'tier3' tier = 'tier3'
logMessage = ' Made Raw Coke tier 3'
end end
end end
if not GetRecipe(src, 'cocaine', 'cokepowder', tier) then return end if not GetRecipe(src, 'cocaine', 'cokepowder', tier) then return end
@@ -130,10 +127,14 @@ local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3}
for k, v in pairs (cokecut) do for k, v in pairs (cokecut) do
QBCore.Functions.CreateUseableItem(k, function(source, item) QBCore.Functions.CreateUseableItem(k, function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
if Player.Functions.GetItemByName(item.name) then if Player.Functions.GetItemByName(item.name) then
if not Itemcheck(src, 'bakingsoda', 1) then return end if not Itemcheck(src, 'bakingsoda', 1) then return end
TriggerClientEvent('md-drugs:client:minusTier', src, {type = 'coke', xt = 'bakingsoda', item = k, amount = v,recieve = 'loosecoke'}) local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting It Further')
end if not check then return end
if RemoveItem(src, k, 1) then
AddItem(src, 'loosecoke', v)
end
end
end) end)
end end
+5 -1
View File
@@ -52,7 +52,11 @@ for k, v in pairs (cokecut) do
local Player = getPlayer(src) local Player = getPlayer(src)
if Player.Functions.GetItemByName(item.name) then if Player.Functions.GetItemByName(item.name) then
if not Itemcheck(src, 'bakingsoda', 1) then return end if not Itemcheck(src, 'bakingsoda', 1) then return end
TriggerClientEvent('md-drugs:client:minusTier', src, {type = 'crack', xt = 'bakingsoda', item = k, amount = v,recieve = 'crackrock'}) local check = lib.callback.await('md-drugs:client:uncuff', src, 'Cutting Crack Rock Further')
if not check then return end
if RemoveItem(src, k, 1) then
AddItem(src, 'crackrock', v)
end
end end
end) end)
end end
+1 -10
View File
@@ -348,13 +348,4 @@ CreateThread(function()
print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' ) print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' )
end end
end, "GET", "", "") end, "GET", "", "")
end) end)
RegisterServerEvent('md-drugs:server:AddMas', function(data)
local src = source
if not data then return end
if not Itemcheck(src, data.xt, 1) then return end
if not RemoveItem(src, data.item, 1) then return end
RemoveItem(src, data.xt, 1)
AddItem(src, data.recieve, data.amount)
end)
+2 -2
View File
@@ -122,7 +122,7 @@ end)
QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item) QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item)
local src = source local src = source
local check = lib.callback.await('md-drugs:client:uncuff', src) local check = lib.callback.await('md-drugs:client:uncuff', src, 'Grinding Weed')
if not check then return end if not check then return end
if RemoveItem(src, "drycannabis",1 ) then if RemoveItem(src, "drycannabis",1 ) then
AddItem(src, "grindedweed", 1) AddItem(src, "grindedweed", 1)
@@ -134,7 +134,7 @@ end)
QBCore.Functions.CreateUseableItem("mdwoods", function(source, item) QBCore.Functions.CreateUseableItem("mdwoods", function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
local check = lib.callback.await('md-drugs:client:uncuff', src) local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
if not check then return end if not check then return end
if RemoveItem(src, "mdwoods",1 ) then if RemoveItem(src, "mdwoods",1 ) then
AddItem(src, "bluntwrap", 5) AddItem(src, "bluntwrap", 5)