removed OnPlayerLoad and Resource Start from prop drugs to functions file to condense repeatable code

This commit is contained in:
Mustache Dom committed 2024-10-25 11:41:59 -07:00
1 parent 24877e6447
commit 99d0ae58be
6 files changed
+46 -117

No files matched your search

+1 -14
View File
@@ -3,7 +3,7 @@ local PoppyPlants = {}
local herointable = false
local function createLabKit(coord, head)
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false)
SetEntityHeading(heroinlabkit, head)
PlaceObjectOnGroundProperly(heroinlabkit)
local options = {
@@ -54,19 +54,6 @@ RegisterNetEvent("heroin:init", function()
end
end)
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
LoadModel('prop_plant_01b')
TriggerEvent('heroin:init')
end
end)
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
Wait(3000)
LoadModel('prop_plant_01b')
TriggerEvent('heroin:init')
end)
AddEventHandler('onResourceStop', function(resourceName)
if GetCurrentResourceName() == resourceName then
SetModelAsNoLongerNeeded(GetHashKey('prop_plant_01b'))