move requestmodel timeout to config

This commit is contained in:
Bostra committed 2024-04-27 20:49:14 -05:00
1 parent d9fbf56164
commit d60d10a5a5
11 files changed
+21 -20

No files matched your search

+6 -6
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+5 -5
View File
@@ -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)
+1
View File
@@ -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