protects from memory editing
This example how you can effectively protect your variables against people, who try to cheat in it using Cheat programs/Memory editors, with a dll that checks the md5 checksum of the variable. It protects against variable changes and freezing. It does not protect from speedhacks (I currently don't know how to block this) but speedhacks are mostly useful for cheating in online games (which checks should be done server-side).
Before use, please realise that there is no 100% protection from memory editing. Never.
This method will annoy many people who like to cheat easily by using programs.
You should also take extra steps to enhance the protection,
Do not show a variable value with a number to the player (for e.g. draw heart sprites instead of "health: 100")
Check for Cheat program processes by using a dll
Obfuscate your source with GM obfuscator (really important)
Remove the debug form (PM me for more info)
Wrap using a software protection program (check my sig)
Edited by Sindarin, 23 September 2008 - 05:01 PM.