Skip to content

Commit

Permalink
fix: entitiesblacklist feat: disable itempickup and entitiesblacklist…
Browse files Browse the repository at this point in the history
… on empty config
  • Loading branch information
artur-michalak authored May 12, 2024
1 parent be8251a commit d5c59f1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 57 deletions.
55 changes: 0 additions & 55 deletions qbx_entitiesblacklist/config.json

This file was deleted.

55 changes: 55 additions & 0 deletions qbx_entitiesblacklist/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
return {
blacklisted = {
[`SHAMAL`] = true,
[`LUXOR`] = true,
[`LUXOR2`] = true,
[`JET`] = true,
[`LAZER`] = true,
[`BUZZARD`] = true,
[`BUZZARD2`] = true,
[`ANNIHILATOR`] = true,
[`SAVAGE`] = true,
[`TITAN`] = true,
[`RHINO`] = true,
[`FIRETRUK`] = true,
[`MULE`] = true,
[`MAVERICK`] = true,
[`BLIMP`] = true,
[`AIRTUG`] = true,
[`CAMPER`] = true,
[`HYDRA`] = true,
[`OPPRESSOR`] = true,
[`technical3`] = true,
[`insurgent3`] = true,
[`apc`] = true,
[`tampa3`] = true,
[`trailersmall2`] = true,
[`halftrack`] = true,
[`hunter`] = true,
[`vigilante`] = true,
[`akula`] = true,
[`barrage`] = true,
[`khanjali`] = true,
[`caracara`] = true,
[`blimp3`] = true,
[`menacer`] = true,
[`oppressor2`] = true,
[`scramjet`] = true,
[`strikeforce`] = true,
[`cerberus`] = true,
[`cerberus2`] = true,
[`cerberus3`] = true,
[`scarab`] = true,
[`scarab2`] = true,
[`scarab3`] = true,
[`rrocket`] = true,
[`ruiner2`] = true,
[`deluxo`] = true,
[`s_m_y_ranger_01`] = true,
[`s_m_y_sheriff_01`] = true,
[`s_m_y_cop_01`] = true,
[`s_f_y_sheriff_01`] = true,
[`s_f_y_cop_01`] = true,
[`s_m_y_hwaycop_01`] = true
}
}
4 changes: 2 additions & 2 deletions qbx_entitiesblacklist/server.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local config = lib.loadJson('qbx_entitiesblacklist.config')
local config = require 'qbx_entitiesblacklist.config'
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
if bucketLockDownMode == 'inactive' or #config.blacklisted == 0 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
Expand Down
2 changes: 2 additions & 0 deletions qbx_itempickup/client.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
local config = lib.loadJson('qbx_itempickup.config')

if #config.disabledPickups == 0 then return end

CreateThread(function()
for _, hash in ipairs(config.disabledPickups) do
ToggleUsePickupsForPlayer(cache.playerId, hash, false)
Expand Down

0 comments on commit d5c59f1

Please sign in to comment.