Skip to content

exec_menuaddtab

Adds a tab to the lua cheat tab

Arguments

Type Description
string tab name
function (return vgui derma)

Example

Print to console with checkbox

1
if not MENU_DLL then return end

if exec_cfg_GetValue("PRINTONSPAWN")==nil then
	exec_cfg_SetValue("PRINTONSPAWN",false)
end

local clientcode = [==[
if exechack_api.cfg_GetValue("PRINTONSPAWN")then
	print(1)
end
]==]

local oldexec_newclientrunned = exec_newclientrunned
exec_newclientrunned = function()
	exec_runtoclientside(clientcode)
	return oldexec_newclientrunned
end
 
exec_menuaddtab("my tab",function()
	exec_menuaddcheckbox("print 1 on spawnserver",15,30,"PRINTONSPAWN","description")
end)

Output: 1 if checkbox enable