Skip to content

Enums

Bitmask flags passed as the flags argument of usems.register_command and usems.register_cvar. Combine with bit32.bor. Values mirror Source’s FCVAR_* constants exactly.

Value Name Meaning
0 NONE No flags — default behavior.
1 UNREGISTERED Don’t add to the engine’s linked list. Rarely useful to mods.
2 DEVELOPMENTONLY Hidden in released products.
4 GAMEDLL Defined by the game DLL.
8 CLIENTDLL Defined by the client DLL.
16 HIDDEN Hidden: not in find or autocomplete.
32 PROTECTED Server cvar whose value isn’t sent (passwords).
64 SPONLY Cannot be changed by clients connected to a server.
128 ARCHIVE Saved to config — the value persists across game restarts.
256 NOTIFY Notifies players when changed.
512 USERINFO Changes go into the client’s info string.
1024 PRINTABLEONLY Value can’t contain unprintable characters.
2048 UNLOGGED Don’t log changes to file/console.
4096 NEVER_AS_STRING Never print this cvar as a string.
8192 REPLICATED Server-enforced value on clients.
16384 CHEAT Only usable with sv_cheats 1 (or singleplayer).
65536 DEMO Recorded when starting a demo.
131072 DONTRECORD Excluded from demo recording.
4194304 NOT_CONNECTED Clients on a server can’t change it.
268435456 SERVER_CAN_EXECUTE Server may run this command on clients.
536870912 SERVER_CANNOT_QUERY Server may not query the value.
1073741824 CLIENTCMD_CAN_EXECUTE ClientCmd may execute this command.

The values aren’t pre-defined in the mod environment — pass raw integers or define them locally:

local FCVAR = {
ARCHIVE = 128,
NOTIFY = 256,
CHEAT = 16384,
}
usems.register_cvar("my_speed", "1.0", FCVAR.ARCHIVE, "Saved across restarts")
usems.register_cvar(
"my_secret",
"",
bit32.bor(128, 32), -- ARCHIVE | PROTECTED
"Archived but never displayed"
)
Goal Flags
Setting that persists 128 (ARCHIVE)
Cheat-gated command 16384 (CHEAT)
Hide from autocomplete 16 (HIDDEN)
Announce changes 256 (NOTIFY)
-- a cheat-gated godmode-style toggle (SP respects CHEAT immediately):
usems.register_cvar("my_godmode", "0", 16384, "Cheat: never take damage (once hooked)")