This is a simple quest reward system for singleplayer or multiplayer minecraft maps. This code can be altered and used to dispense anything you want to the player, but for the purposes of this example it's set to give players 10 full XP levels for every 10 mobs they kill.
If you lay out a setup as shown in the image, and enter the appropriate code to the command blocks, the system will run very smoothly. This is, of course, under the assumption that you know how to give yourself command blocks and opt yourself to use them. If you don't, enter these two command codes when in creative mode.
/give @p 137
You can find your XYZ coordinates by pressing F3.
EDIT: In the PAYMENT code it should be "players" not "player."