fixed bugs
This commit is contained in:
1 parent
9d828a2b15
commit
abb1bba3fe
11 files changed
+30
-29
No files matched your search
@@ -557,7 +557,7 @@ end
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
Wait(3000)
|
||||
LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') LoadModel('bkr_prop_weed_lrg_01b')
|
||||
LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('bkr_prop_weed_lrg_01b')
|
||||
local check = lib.callback.await('md-drugs:server:GetRep', false)
|
||||
|
||||
return
|
||||
@@ -565,7 +565,7 @@ end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
LoadModel('prop_plant_01b') LoadModel('prop_plant_01a') LoadModel('prop_cactus_03') LoadModel('mushroom') 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)
|
||||
local active = false
|
||||
|
||||
@@ -110,8 +110,6 @@ CreateThread(function()
|
||||
if amonia and heated == nil then return true end end
|
||||
})
|
||||
if Config.MethHeist == false then
|
||||
local config = lib.callback.await('md-drugs:server:getLocs', false)
|
||||
if not config then return end
|
||||
AddBoxZoneMulti('methep', config.MethEph, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'})
|
||||
AddBoxZoneMulti('methace', config.Methace, {icon = "fas fa-sign-in-alt", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'})
|
||||
end
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
local config = lib.callback.await('md-drugs:server:getLocs', false)
|
||||
|
||||
|
||||
CreateThread(function()
|
||||
local config = lib.callback.await('md-drugs:server:getLocs', false)
|
||||
local model = {"g_m_y_famdnf_01", 's_m_m_doctor_01', 'u_m_m_jesus_01'}
|
||||
for k, v in pairs (model) do
|
||||
lib.requestModel(v, Config.RequestModelTime)
|
||||
|
||||
+12
-8
@@ -1,18 +1,22 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local shrooms = {}
|
||||
|
||||
local function LoadModels(hash)
|
||||
hash = GetHashKey(hash)
|
||||
RequestModel(hash)
|
||||
local timeout = GetGameTimer() + 5000 -- 5-second timeout
|
||||
while not HasModelLoaded(hash) and GetGameTimer() < timeout do
|
||||
Wait(10)
|
||||
end
|
||||
if HasModelLoaded(hash) then return true end
|
||||
|
||||
end
|
||||
|
||||
local function pick(loc)
|
||||
if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("shrooms:pickupCane", loc)
|
||||
end
|
||||
|
||||
function LoadModel(hash)
|
||||
RequestModel(hash)
|
||||
while not HasModelLoaded(hash) do
|
||||
Wait(0)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('shrooms:respawnCane', function(loc)
|
||||
local v = GlobalState.shrooms[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -42,7 +46,7 @@ end)
|
||||
RegisterNetEvent("shrooms:init", function()
|
||||
for k, v in pairs (GlobalState.shrooms) do
|
||||
local hash = GetHashKey(v.model)
|
||||
lib.requestModel(v.model, Config.RequestModelTime)
|
||||
if not HasModelLoaded(hash) then LoadModels(hash) end
|
||||
if not v.taken then
|
||||
shrooms[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
|
||||
Freeze(shrooms[k], true, v.heading)
|
||||
|
||||
Reference in new issue
Block a user