The reason I changed them to local variables was so I could test them with MessageBox to see if the address was correct, I have no idea what that code says because I cbf to go read it again. But I have changed it a lot since then, they are now back to pointers and some other things have been changed. So far the game still crashes.
Edit: I have determined the source of this error, it's a problem in the addition of the two pointers. When I return GetModuleHandle("engine.dll") alone, I get an address. And when I open up ms Calculator and add 544810 to it in hex, I get the correct address of sv_cheats. Unfortunately, when I try adding the two together in code, I get some crazy address that probably doesn't even exist. So I simply need a method of adding together the two pointers so that they may return the proper hex value.
Edit2: I finally fixed it, not sure how it wasn't working before because I simple made a function to add the inputted value to GetModuleHandle("engine.dll") and output the result, and it works.
~lilneo