Allowing DNumSlider change value to sv_allowcslua?


How can i make DNumSlider change sv_allowcslua value 0-1 with derma?

I have setted up DNumSlider but it is not allowed cl side.

Maybe somehow detect if the number changed from 0 to 1 or 1 to 0? Then i can itself use net to change it.

So what i need is some function that detects change from 0 to 1 or 1 to 0 and it runs one time when changed.

Use derma:ValueChanged()
and network the value from client to serverside and then you check serverside if the value that has changed equals to one then you use RunConsoleCommand() and change the the sv_allowslua value.

Make sure to check that the person who sent the net message to change the cvar actually is authorized to do so. It would be extremely exploitable if you left a cvar as important as that be changed by any client who can use a bypasser.