fixed bugs

This commit is contained in:
Mustache Dom committed 2024-11-12 02:07:16 -08:00
1 parent 9d828a2b15
commit abb1bba3fe
11 files changed
+29 -28

No files matched your search

+2 -2
View File
@@ -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
-2
View File
@@ -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
+2 -1
View File
@@ -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
View File
@@ -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)
+2 -1
View File
@@ -26,7 +26,8 @@ lua54 'yes'
dependency 'bob74_ipl'
files {
'stream/mushroom.ytyp'
'stream/mushroom.ytyp',
'stream/mushroom.ydr'
}
data_file 'DLC_ITYP_REQUEST' 'stream/mushroom.ytyp'
-2
View File
@@ -13,7 +13,6 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
}
for _, v in ipairs(crackTiers) do
if count >= 1 then break end
print(v.item)
if Player.Functions.GetItemByName(v.item) then
tier = v.tier
count = count + 1
@@ -21,7 +20,6 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
end
end
end
print(tier)
if not GetRecipe(src, 'crack', type, tier) then return end
end)
+2 -2
View File
@@ -1,5 +1,5 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.PoppyPlants = Config.PoppyPlants
local h = {
{ location = vector3(-2251.3, -99.18, 100.11), heading = 334.49, model = "prop_plant_01b"},
{ location = vector3(-2249.63, -92.97, 101.8), heading = 329.56, model = "prop_plant_01b"},
@@ -15,7 +15,7 @@ local h = {
{ location = vector3(-2250.96, -111.22, 97.50), heading = 21.52, model = "prop_plant_01b"},
{ location = vector3(465.95, -1021.32, 31.78), heading = 21.52, model = "prop_plant_01b"},
}
GlobalState.PoppyPlants = h
Citizen.CreateThread(function()
for _, v in pairs(h) do
v.taken = false
+4 -1
View File
@@ -129,7 +129,10 @@ function checkLoc(source, event, num)
return false
end
end
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
lib.callback.register('md-drugs:server:getLocs', function()
return Target
end)
lib.callback.register('md-drugs:server:GetMerchant', function(source)
return loc
end)
+2 -1
View File
@@ -1,5 +1,5 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.Mescaline = Config.Mescaline
local m = {
{ location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"},
{ location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"},
@@ -19,6 +19,7 @@ local m = {
{ location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"},
{ location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"},
}
GlobalState.Mescaline = m
Citizen.CreateThread(function()
for _, v in pairs(m) do
v.taken = false
+1 -6
View File
@@ -1,6 +1,5 @@
local QBCore = exports['qb-core']:GetCoreObject()
local config = lib.callback.await('md-drugs:server:getLocs', false)
local loc = config.Travellingmerchant[math.random(1, #config.Travellingmerchant)]
local stores = {
travel = {
{name = "tab_paper", price = 50, amount = 50, },
@@ -79,7 +78,3 @@ RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, ite
end
end
end)
lib.callback.register('md-drugs:server:GetMerchant', function(source)
return loc
end)
+2 -2
View File
@@ -1,5 +1,5 @@
local QBCore = exports['qb-core']:GetCoreObject()
GlobalState.shrooms = Config.shrooms
local s = {
{ location = vector3(2185.14, 5183.81, 57.48), heading = 334.49, model = "mushroom"},
{ location = vector3(2174.45, 5187.85, 57.43), heading = 329.56, model = "mushroom"},
@@ -19,7 +19,7 @@ local s = {
{ location = vector3(2185.85, 5190.49, 58.1), heading = 21.52, model = "mushroom"},
{ location = vector3(2179.95, 5194.19, 58.26), heading = 21.52, model = "mushroom"},
}
GlobalState.shrooms = s
Citizen.CreateThread(function()
for _, v in pairs(s) do
v.taken = false