CodeGS posted a link to cvar3 in another thread which I have been looking for the server sided version as well as the code for ages. So big thanks to him.
I’ve been unable to find any documentation on cvar3, but I’m still able to figure out 90% of everything from the code. With that said, I’ve run into two problems.
I’m trying to loop through all cvars and remove flags from them like so:
require("cvar3") local dbg = debug.getregistry() for k, v in pairs(cvars.GetAllCommands()) do if dbg.ConVar.HasFlag(v, FCVAR_DEVELOPMENTONLY) then print("has flag") dbg.ConVar.SetFlags(v, dbg.ConVar.GetFlags(v) - FCVAR_DEVELOPMENTONLY) print(v:GetName()) end end
That outputs this error:
[ERROR] gamemodes/flood/gamemode/init.lua:308: bad argument #2 to 'HasFlag' (convar expected, got number) 1. HasFlag - [C]:-1 2. unknown - gamemodes/flood/gamemode/init.lua:308 3. unknown - lua/includes/modules/concommand.lua:54
I tried changing
if dbg.ConVar.HasFlag(v, FCVAR_DEVELOPMENTONLY) then
if dbg.ConVar.HasFlag(GetConVar(v:GetName()), FCVAR_DEVELOPMENTONLY) then
However it still spits out the same error.
Both of these output no errors and do nothing.
print(dbg.Player.GetUserSetting(Entity(1), "voice_enable")) dbg.Player.ExecuteCommandOnClient(Entity(1), "print_colorcorrection")