Merge pull request #34 from B0STRA/main
move requestmodel timeout to config
This commit is contained in:
11 files changed
+23
-22
No files matched your search
@@ -480,9 +480,9 @@ local spawnedCar = {}
|
|||||||
if started then
|
if started then
|
||||||
else
|
else
|
||||||
started = true
|
started = true
|
||||||
lib.requestModel(`pounder`, 500)
|
lib.requestModel(`pounder`, Config.requestModelTime)
|
||||||
lib.requestModel("ig_priest", 500)
|
lib.requestModel("ig_priest", Config.requestModelTime)
|
||||||
lib.requestModel(`cargobob3`, 500)
|
lib.requestModel(`cargobob3`, Config.requestModelTime)
|
||||||
leancar = CreateVehicle(`pounder`, start.x+3, start.y-2, start.z-1, 52.0, true, true)
|
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)
|
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)
|
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
|
if startedmeth then
|
||||||
else
|
else
|
||||||
startedmeth = true
|
startedmeth = true
|
||||||
lib.requestModel(`journey`, 500)
|
lib.requestModel(`journey`, Config.requestModelTime)
|
||||||
lib.requestModel("a_m_m_hillbilly_02", 500)
|
lib.requestModel("a_m_m_hillbilly_02", Config.requestModelTime)
|
||||||
lib.requestModel(`cargobob3`, 500)
|
lib.requestModel(`cargobob3`, Config.requestModelTime)
|
||||||
methcar = CreateVehicle(`journey`, start.x+3, start.y-2, start.z-1, 52.0, true, true)
|
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)
|
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)
|
methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, true, false)
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ local cuttingcoke = nil
|
|||||||
local baggingcoke = nil
|
local baggingcoke = nil
|
||||||
function LoadModel(hash)
|
function LoadModel(hash)
|
||||||
hash = GetHashKey(hash)
|
hash = GetHashKey(hash)
|
||||||
lib.requestModel(hash, 500)
|
lib.requestModel(hash, Config.requestModelTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent('coke:respawnCane', function(loc)
|
RegisterNetEvent('coke:respawnCane', function(loc)
|
||||||
|
|||||||
+3
-3
@@ -22,7 +22,7 @@ end
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local Ped = "g_m_y_famdnf_01"
|
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
|
labkitlocation = Config.buyheroinlabkit
|
||||||
heroinkitdealer = CreatePed(0, Ped,labkitlocation.x, labkitlocation.y, labkitlocation.z-1, 180.0, false, false)
|
heroinkitdealer = CreatePed(0, Ped,labkitlocation.x, labkitlocation.y, labkitlocation.z-1, 180.0, false, false)
|
||||||
FreezeEntityPosition(heroinkitdealer, true)
|
FreezeEntityPosition(heroinkitdealer, true)
|
||||||
@@ -262,7 +262,7 @@ AddEventHandler("md-drugs:client:cleanheroinlabkit", function()
|
|||||||
disableMouse = false,
|
disableMouse = false,
|
||||||
disableCombat = true,
|
disableCombat = true,
|
||||||
disableInventory = true,
|
disableInventory = true,
|
||||||
}, {}, {}, {}, function()-- Done
|
}, {}, {}, {}, function()-- Done
|
||||||
|
|
||||||
TriggerServerEvent("md-drugs:server:removecleaningkitheroin")
|
TriggerServerEvent("md-drugs:server:removecleaningkitheroin")
|
||||||
ClearPedTasks(PlayerPedId())
|
ClearPedTasks(PlayerPedId())
|
||||||
@@ -271,7 +271,7 @@ end)
|
|||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:deletedirtyheroin")
|
RegisterNetEvent("md-drugs:client:deletedirtyheroin")
|
||||||
AddEventHandler("md-drugs:client:deletedirtyheroin", function()
|
AddEventHandler("md-drugs:client:deletedirtyheroin", function()
|
||||||
DeleteObject(dirtylabkitheroin)
|
DeleteObject(dirtylabkitheroin)
|
||||||
herointable = false
|
herointable = false
|
||||||
Wait(1000)
|
Wait(1000)
|
||||||
TriggerEvent("md-drugs:client:setheroinlabkit")
|
TriggerEvent("md-drugs:client:setheroinlabkit")
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local current = "s_m_m_doctor_01"
|
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)
|
SyrupLocation = CreatePed(0, current,Config.SyrupVendor.x,Config.SyrupVendor.y,Config.SyrupVendor.z-1, false, false)
|
||||||
FreezeEntityPosition(SyrupLocation, true)
|
FreezeEntityPosition(SyrupLocation, true)
|
||||||
SetEntityInvincible(SyrupLocation, true)
|
SetEntityInvincible(SyrupLocation, true)
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ end
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local Ped = "g_m_y_famdnf_01"
|
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)
|
tabdealer = CreatePed(0, Ped,Config.buylsdlabkit.x,Config.buylsdlabkit.y,Config.buylsdlabkit.z-1, 180.0, false, false)
|
||||||
FreezeEntityPosition(tabdealer, true)
|
FreezeEntityPosition(tabdealer, true)
|
||||||
SetEntityInvincible(tabdealer, true)
|
SetEntityInvincible(tabdealer, true)
|
||||||
|
|||||||
+1
-1
@@ -221,7 +221,7 @@ end)
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local current = "g_m_y_famdnf_01"
|
local current = "g_m_y_famdnf_01"
|
||||||
lib.requestModel(current, 1000)
|
lib.requestModel(current, Config.requestModelTime)
|
||||||
local CurrentLocation = Config.MethHeistStart
|
local CurrentLocation = Config.MethHeistStart
|
||||||
methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false)
|
methdealer = CreatePed(0, current, CurrentLocation.x, CurrentLocation.y, CurrentLocation.z - 1, false, false)
|
||||||
FreezeEntityPosition(methdealer, true)
|
FreezeEntityPosition(methdealer, true)
|
||||||
|
|||||||
+2
-2
@@ -20,7 +20,7 @@ end
|
|||||||
RegisterNetEvent("md-drugs:Client:getoxylocation", function()
|
RegisterNetEvent("md-drugs:Client:getoxylocation", function()
|
||||||
local coords = Config.truckspawn
|
local coords = Config.truckspawn
|
||||||
local ModelHash = "burrito3" -- Use Compile-time hashes to get the hash of this model
|
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)
|
local oxycar = CreateVehicle(ModelHash,Config.truckspawn.x, Config.truckspawn.y,Config.truckspawn.z, Config.truckspawn.h, true, false)
|
||||||
SetEntityHeading(oxycar, coords.w)
|
SetEntityHeading(oxycar, coords.w)
|
||||||
exports[Config.Fuel]:SetFuel(oxycar, 100.0)
|
exports[Config.Fuel]:SetFuel(oxycar, 100.0)
|
||||||
@@ -72,7 +72,7 @@ AddEventHandler("md-drugs:client:getoxylocationroute", function()
|
|||||||
PolicecallOxy()
|
PolicecallOxy()
|
||||||
end
|
end
|
||||||
local current = "g_m_y_famdnf_01"
|
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)
|
oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, false, false)
|
||||||
SetEntityHeading(oxybuyer, 180)
|
SetEntityHeading(oxybuyer, 180)
|
||||||
FreezeEntityPosition(oxybuyer, true)
|
FreezeEntityPosition(oxybuyer, true)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local current = "g_m_y_famdnf_01"
|
local current = "g_m_y_famdnf_01"
|
||||||
lib.requestModel(current, timeout)
|
lib.requestModel(current, Config.requestModelTime)
|
||||||
local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)]
|
local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)]
|
||||||
travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false)
|
travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false)
|
||||||
FreezeEntityPosition(travellingmerchant, true)
|
FreezeEntityPosition(travellingmerchant, true)
|
||||||
|
|||||||
+1
-1
@@ -531,7 +531,7 @@ end)
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local WeedShop = {}
|
local WeedShop = {}
|
||||||
local current = "u_m_m_jesus_01"
|
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)
|
local CurrentLocation = vector3(1030.46, -3203.63, -38.2)
|
||||||
WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false)
|
WeedGuy = CreatePed(0,current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false)
|
||||||
FreezeEntityPosition(WeedGuy, true)
|
FreezeEntityPosition(WeedGuy, true)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ AddEventHandler("md-drugs:client:getloccoke", function()
|
|||||||
SetBlipRoute(deliveryBlip, true)
|
SetBlipRoute(deliveryBlip, true)
|
||||||
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cokesell", debugPoly = false })
|
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cokesell", debugPoly = false })
|
||||||
druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end)
|
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"
|
local current = "g_m_y_famdnf_01"
|
||||||
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||||
FreezeEntityPosition(drugdealer, true)
|
FreezeEntityPosition(drugdealer, true)
|
||||||
@@ -119,7 +119,7 @@ AddEventHandler("md-drugs:client:getloccrack", function()
|
|||||||
SetBlipRoute(deliveryBlip, true)
|
SetBlipRoute(deliveryBlip, true)
|
||||||
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cracksell", debugPoly = false })
|
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "cracksell", debugPoly = false })
|
||||||
druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end)
|
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"
|
local current = "g_m_y_famdnf_01"
|
||||||
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||||
FreezeEntityPosition(drugdealer, true)
|
FreezeEntityPosition(drugdealer, true)
|
||||||
@@ -210,7 +210,7 @@ AddEventHandler("md-drugs:client:getlocheroin", function()
|
|||||||
SetBlipRoute(deliveryBlip, true)
|
SetBlipRoute(deliveryBlip, true)
|
||||||
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "heroinsell", debugPoly = false })
|
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "heroinsell", debugPoly = false })
|
||||||
druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end)
|
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"
|
local current = "g_m_y_famdnf_01"
|
||||||
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||||
FreezeEntityPosition(drugdealer, true)
|
FreezeEntityPosition(drugdealer, true)
|
||||||
@@ -299,7 +299,7 @@ AddEventHandler("md-drugs:client:getloclsd", function()
|
|||||||
SetBlipRoute(deliveryBlip, true)
|
SetBlipRoute(deliveryBlip, true)
|
||||||
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "lsdsell", debugPoly = false })
|
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "lsdsell", debugPoly = false })
|
||||||
druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end)
|
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"
|
local current = "g_m_y_famdnf_01"
|
||||||
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||||
FreezeEntityPosition(drugdealer, true)
|
FreezeEntityPosition(drugdealer, true)
|
||||||
@@ -387,7 +387,7 @@ AddEventHandler("md-drugs:client:getlocxtc", function()
|
|||||||
SetBlipRoute(deliveryBlip, true)
|
SetBlipRoute(deliveryBlip, true)
|
||||||
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "xtcsell", debugPoly = false })
|
druglocation = CircleZone:Create(CurrentLocation, 5,{ name = "xtcsell", debugPoly = false })
|
||||||
druglocation:onPlayerInOut(function(isPointInside) if isPointInside then RemoveBlip(deliveryBlip) end end)
|
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"
|
local current = "g_m_y_famdnf_01"
|
||||||
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||||
FreezeEntityPosition(drugdealer, true)
|
FreezeEntityPosition(drugdealer, true)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Config.rewardItemheroin = "poppyresin"
|
|||||||
Config.rewardshrooms = "shrooms"
|
Config.rewardshrooms = "shrooms"
|
||||||
Config.rewardMescaline = "cactusbulb"
|
Config.rewardMescaline = "cactusbulb"
|
||||||
Config.rewardWeed = "wetcannabis"
|
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.oxtarget = true --- turn to true if you use oxtarget
|
||||||
Config.respawnTime = 150 -- Seconds
|
Config.respawnTime = 150 -- Seconds
|
||||||
Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel
|
Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel
|
||||||
|
|||||||
Reference in new issue
Block a user