mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Apply cvar fix to other files too
This commit is contained in:
parent
116adbcdff
commit
c1c8e0b6d0
@ -61,6 +61,8 @@ function PART:PreInitialize()
|
||||
self.hide_disturbing = false
|
||||
self.active_events = {}
|
||||
self.active_events_ref_count = 0
|
||||
local cvarName = "pac_enable_" .. string.Replace(self.ClassName, " ", "_"):lower()
|
||||
if not GetConVar(cvarName):GetBool() then self:SetWarning("This part class is disabled! Enable it with " .. cvarName .. " 1") end
|
||||
end
|
||||
|
||||
function PART:Initialize() end
|
||||
|
@ -89,7 +89,7 @@ function pac.RegisterPart(META)
|
||||
local cvarName = "pac_enable_" .. string.Replace(META.ClassName, " ", "_"):lower()
|
||||
local cvar = CreateClientConVar(cvarName, "1", true)
|
||||
|
||||
cvars.AddChangeCallback("pac_enable_" .. META.ClassName, function(name, old, new)
|
||||
cvars.AddChangeCallback(cvarName, function(name, old, new)
|
||||
local enable = tobool(new)
|
||||
META.GloballyEnabled = enable
|
||||
if enable then
|
||||
|
Loading…
Reference in New Issue
Block a user