Add force onuse server option

This commit is contained in:
Redox 2022-11-20 03:23:44 +01:00
parent 2bb09cde8a
commit 073d76737c
No known key found for this signature in database
GPG Key ID: C10A433A95068388
3 changed files with 12 additions and 1 deletions

View File

@ -575,9 +575,18 @@ function pac.FlashlightDisable(b)
end
local pacOnUseConvar = CreateClientConVar('pac_onuse_only', '0', true, false, 'Enable "on +use only" mode. Within this mode, outfits are not being actually "loaded" until you hover over player and press your use button')
local pacOnUseConvar = CreateClientConVar("pac_onuse_only", "0", true, false, 'Enable "on +use only" mode. Within this mode, outfits are not being actually "loaded" until you hover over player and press your use button')
local pacOnUseOverrideConvar = CreateClientConVar("pac_onuse_override", "0", true, false, 'Overrides the server default "on +use only" mode. This is useful if you want to enable "on +use only" mode on servers that have it disabled')
local pacOnUseForceConvar = CreateConVar("pac_onuse_only_force", "0", FCVAR_REPLICATED, 'Forces the default for onuse to be ON on players that have not enabled the override.')
function pac.IsPacOnUseOnly()
local clientConvarBool = pacOnUseConvar:GetBool()
if pacOnUseForceConvar:GetBool() then
if pacOnUseOverrideConvar:GetBool() then
return false
end
return true
end
return clientConvarBool
end

View File

@ -0,0 +1 @@
CreateConVar("pac_onuse_only_force", "0", FCVAR_ARCHIVE + FCVAR_REPLICATED , "Forces the default for onuse to be ON on players that have not enabled the override.")

View File

@ -11,6 +11,7 @@ CreateConVar('pac_allow_mdl', '1', CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHI
CreateConVar('pac_allow_mdl_entity', '1', CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHIVE, FCVAR_REPLICATED}, 'Allow to use custom MDLs as Entity')
include("util.lua")
include("convars.lua")
include("pac3/core/shared/init.lua")