I am making a gamemode and I am making a small admin panel that allows you to control the weapons people can use. I am making custom cvars for every weapon (epic_weapon_pistol for the 9mm pistol) and attempting to change theme through a durma screen. You can see the screen here:
http://x3non.com/image/alec/110/admin-panel.png
Each item looks like this
local weapon_crowbar = vgui.Create( "DCheckBoxLabel" )
weapon_crowbar:SetText( "Crowbar" )
weapon_crowbar:SetConVar( "epic_weapon_crowbar" )
weapon_crowbar:SetValue( GetConVarNumber("epic_weapon_crowbar") )
weapon_crowbar:SizeToContents() -- Size it to the list's size
WeaponList:AddItem( weapon_crowbar ) -- Add the item above
The changes are applied client side, but that isn’t good enough. I need them changed server side.
I can tell they are change client side because I type epic_weapon_crowbar in the console and it shows 0 if unchecked and 1 if check. On the server it is always 1 (the default).
Thanks guys.
[editline]05:26PM[/editline]
What is really odd is that the client remembers the cvar settings in between sessions.