Fixing a tonne of should-be-local variables

Using https://github.com/wiox/gmod-global-finder to find functions that
define global variables and then manually inspecting each, I have
modified any variables that appear to have accidentally been made global
to be local.