From 7da5017e25ea3a9314ba7cdba034f748c751453d Mon Sep 17 00:00:00 2001 From: FjamZoo <34508112+FjamZoo@users.noreply.github.com> Date: Thu, 30 Nov 2023 01:39:04 +0100 Subject: [PATCH] feat(entityCreating): Only load if clients can spawn networked entities * feat(entityCreating): Only load if clients can spawn networked entities * add comment --- server/entities.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/entities.lua b/server/entities.lua index 98fc09d..7ccf8f3 100644 --- a/server/entities.lua +++ b/server/entities.lua @@ -1,3 +1,8 @@ +local bucketLockDownMode = GetConvar('qbx:bucketlockdownmode', 'relaxed') + +-- If you want to blacklist peds and vehicles from certaiin locations utilize Car gens ymaps as done in streams/car_gen_disablers, as entityCreating handler is very expensive compared to ymap. +if bucketLockDownMode == 'inactive' then return end + -- Blacklisting entities can just be handled entirely server side with onesync events -- No need to run coroutines to supress or delete these when we can simply delete them before they spawn AddEventHandler('entityCreating', function(handle) @@ -6,4 +11,4 @@ AddEventHandler('entityCreating', function(handle) if Config.BlacklistedVehs[entityModel] or Config.BlacklistedPeds[entityModel] then CancelEvent() end -end) \ No newline at end of file +end)