diff --git a/client/animationsandfunctions.lua b/client/animationsandfunctions.lua index 1ac344b..03d96f9 100644 --- a/client/animationsandfunctions.lua +++ b/client/animationsandfunctions.lua @@ -480,9 +480,9 @@ local spawnedCar = {} if started then else started = true - lib.requestModel(`pounder`, 500) - lib.requestModel("ig_priest", 500) - lib.requestModel(`cargobob3`, 500) + lib.requestModel(`pounder`, Config.requestModelTime) + lib.requestModel("ig_priest", Config.requestModelTime) + lib.requestModel(`cargobob3`, Config.requestModelTime) leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, true, true) driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, true, false) pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) @@ -565,9 +565,9 @@ local searchmeth = false if startedmeth then else startedmeth = true - lib.requestModel(`journey`, 500) - lib.requestModel("a_m_m_hillbilly_02", 500) - lib.requestModel(`cargobob3`, 500) + lib.requestModel(`journey`, Config.requestModelTime) + lib.requestModel("a_m_m_hillbilly_02", Config.requestModelTime) + lib.requestModel(`cargobob3`, Config.requestModelTime) methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, true, true) methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, true, false) methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false) diff --git a/client/cocaine.lua b/client/cocaine.lua index cb3141b..7c91f21 100644 --- a/client/cocaine.lua +++ b/client/cocaine.lua @@ -4,7 +4,7 @@ local cuttingcoke = nil local baggingcoke = nil function LoadModel(hash) hash = GetHashKey(hash) - lib.requestModel(hash, 500) + lib.requestModel(hash, Config.requestModelTime) end RegisterNetEvent('coke:respawnCane', function(loc) diff --git a/client/heroin.lua b/client/heroin.lua index 1e8b9c4..444689a 100644 --- a/client/heroin.lua +++ b/client/heroin.lua @@ -22,7 +22,7 @@ end CreateThread(function() local Ped = "g_m_y_famdnf_01" - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) labkitlocation = Config.buyheroinlabkit heroinkitdealer = CreatePed(0, Ped,labkitlocation.x, labkitlocation.y, labkitlocation.z-1, 180.0, false, false) FreezeEntityPosition(heroinkitdealer, true) @@ -262,7 +262,7 @@ AddEventHandler("md-drugs:client:cleanheroinlabkit", function() disableMouse = false, disableCombat = true, disableInventory = true, - }, {}, {}, {}, function()-- Done + }, {}, {}, {}, function()-- Done TriggerServerEvent("md-drugs:server:removecleaningkitheroin") ClearPedTasks(PlayerPedId()) @@ -271,7 +271,7 @@ end) RegisterNetEvent("md-drugs:client:deletedirtyheroin") AddEventHandler("md-drugs:client:deletedirtyheroin", function() -DeleteObject(dirtylabkitheroin) +DeleteObject(dirtylabkitheroin) herointable = false Wait(1000) TriggerEvent("md-drugs:client:setheroinlabkit") diff --git a/client/lean.lua b/client/lean.lua index 3419c18..348e118 100644 --- a/client/lean.lua +++ b/client/lean.lua @@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject() CreateThread(function() local current = "s_m_m_doctor_01" - lib.requestModel(current, 500) + lib.requestModel(current, Config.requestModelTime) SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, false, false) FreezeEntityPosition(SyrupLocation, true) SetEntityInvincible(SyrupLocation, true) diff --git a/client/lsd.lua b/client/lsd.lua index b9e7b7f..7280d4b 100644 --- a/client/lsd.lua +++ b/client/lsd.lua @@ -12,7 +12,7 @@ end CreateThread(function() local Ped = "g_m_y_famdnf_01" - lib.requestModel(Ped, 500) + lib.requestModel(Ped, Config.requestModelTime) tabdealer = CreatePed(0, Ped,Config.buylsdlabkit.x,Config.buylsdlabkit.y,Config.buylsdlabkit.z-1, 180.0, false, false) FreezeEntityPosition(tabdealer, true) SetEntityInvincible(tabdealer, true) diff --git a/client/meth.lua b/client/meth.lua index 759705a..895d880 100644 --- a/client/meth.lua +++ b/client/meth.lua @@ -221,7 +221,7 @@ end) CreateThread(function() local current = "g_m_y_famdnf_01" - lib.requestModel(current, 1000) + lib.requestModel(current, Config.requestModelTime) local CurrentLocation = Config.MethHeistStart methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false) FreezeEntityPosition(methdealer, true) diff --git a/client/oxyruns.lua b/client/oxyruns.lua index 12f5b63..2102fab 100644 --- a/client/oxyruns.lua +++ b/client/oxyruns.lua @@ -20,7 +20,7 @@ end RegisterNetEvent("md-drugs:Client:getoxylocation", function() local coords = Config.truckspawn local ModelHash = "burrito3" -- Use Compile-time hashes to get the hash of this model - lib.requestModel(ModelHash, 500) + lib.requestModel(ModelHash, Config.requestModelTime) local oxycar = CreateVehicle(ModelHash,Config.truckspawn.x, Config.truckspawn.y,Config.truckspawn.z, Config.truckspawn.h, true, false) SetEntityHeading(oxycar, coords.w) exports[Config.Fuel]:SetFuel(oxycar, 100.0) @@ -72,7 +72,7 @@ AddEventHandler("md-drugs:client:getoxylocationroute", function() PolicecallOxy() end local current = "g_m_y_famdnf_01" - lib.requestModel(current, 500) + lib.requestModel(current, Config.requestModelTime) oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, false, false) SetEntityHeading(oxybuyer, 180) FreezeEntityPosition(oxybuyer, true) diff --git a/client/travellingmerchant.lua b/client/travellingmerchant.lua index 14f3be7..48e7a6b 100644 --- a/client/travellingmerchant.lua +++ b/client/travellingmerchant.lua @@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject() CreateThread(function() local current = "g_m_y_famdnf_01" - lib.requestModel(current, timeout) + lib.requestModel(current, Config.requestModelTime) local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)] travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false) FreezeEntityPosition(travellingmerchant, true) diff --git a/client/weed.lua b/client/weed.lua index 1372e95..3a516ea 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -531,7 +531,7 @@ end) CreateThread(function() local WeedShop = {} local current = "u_m_m_jesus_01" -lib.requestModel(current, timeout) +lib.requestModel(current, Config.requestModelTime) local CurrentLocation = vector3(1030.46, -3203.63, -38.2) WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false) FreezeEntityPosition(WeedGuy, true) diff --git a/client/wholesale.lua b/client/wholesale.lua index d614b1b..d386e78 100644 --- a/client/wholesale.lua +++ b/client/wholesale.lua @@ -28,7 +28,7 @@ AddEventHandler("md-drugs:client:getloccoke", function() SetBlipRoute(deliveryBlip, true) druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cokesell", debugPoly = false }) druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end) - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) local current = "g_m_y_famdnf_01" drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) @@ -119,7 +119,7 @@ AddEventHandler("md-drugs:client:getloccrack", function() SetBlipRoute(deliveryBlip, true) druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cracksell", debugPoly = false }) druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end) - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) local current = "g_m_y_famdnf_01" drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) @@ -210,7 +210,7 @@ AddEventHandler("md-drugs:client:getlocheroin", function() SetBlipRoute(deliveryBlip, true) druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "heroinsell", debugPoly = false }) druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end) - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) local current = "g_m_y_famdnf_01" drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) @@ -299,7 +299,7 @@ AddEventHandler("md-drugs:client:getloclsd", function() SetBlipRoute(deliveryBlip, true) druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "lsdsell", debugPoly = false }) druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end) - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) local current = "g_m_y_famdnf_01" drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) @@ -387,7 +387,7 @@ AddEventHandler("md-drugs:client:getlocxtc", function() SetBlipRoute(deliveryBlip, true) druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "xtcsell", debugPoly = false }) druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end) - lib.requestModel("g_m_y_famdnf_01", 500) + lib.requestModel("g_m_y_famdnf_01", Config.requestModelTime) local current = "g_m_y_famdnf_01" drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false) FreezeEntityPosition(drugdealer, true) diff --git a/shared/config.lua b/shared/config.lua index 47cfa53..2a5a15f 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -6,6 +6,7 @@ Config.rewardItemheroin = "poppyresin" Config.rewardshrooms = "shrooms" Config.rewardMescaline = "cactusbulb" Config.rewardWeed = "wetcannabis" +Config.requestModelTime = 30000 -- time for ox_lib to request the model to spawn props, increase based on your server and player's experience with failed model requests Config.oxtarget = true --- turn to true if you use oxtarget Config.respawnTime = 150 -- Seconds Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel