Whenever you have a serious oil leak; it is extremely important to check and refill the engine oil level before EACH time the truck is driven. This should be done when the truck is on level ground and the engine is not running; by pulling the engine oil dipstick (NOT THE AUTOMATIC TRANSMISSION FLUID DIPSTICK) out, wiping it off with a rag, putting it fully back in and then pulling it out and reading the oil level. If the oil is not visible on the dipstick, or the level is below the "add" mark; add oil at the engine oil filler opening until the dipstick shows full. Keep a case of the oil you use in the truck; so there will always be enough oil at hand to fill the crankcase.
If the engine runs out of oil; which is what it sounds like caused the check engine light to come on; it can cause major damage to the engine.
At this time; all you can do is to check and refill the engine oil. Then try to start it. If it starts and runs normally; you are fortunate. When the engine is full of oil; if it makes bad noises or does not stay running, take it to a shop for diagnosis. Be prepared for a major expense, if the engine has been damaged.