Moved here in "questions" place
Another way
This works pushing K, if you wanna change the key change it where u read: "set bind k 'vstr demotoggle'"
Copy the followin text in a file and rename it demo.cfg
Then in game /exec demo
set demoon "g_syncronousclients 1;record;g_syncronousclients 0;echo You are currently ^2Recording a demo.;set demotoggle vstr demooff"
set demooff "stoprecord;echo You are currently ^1Not ^1Recording a demo.;set demotoggle vstr demoon"
set demotoggle "vstr demoon"
bind k "vstr demotoggle"
echo Demo Toggle : Loaded