[MENTION=70574]TheMasterGeneral[/MENTION]
Here's how you can cut your filesize down and a little easier to read:
A lot of these are fairly similar.
case 22:
$flakes = rand(20, 60);
$expgain = (0.2*$flakes);
echo "While mining away, you have uncovered {$flakes} Silver Flakes!";
item_add($userid, $silverflakesid, $flakes); //Replace 68 with your Silver Flakes item ID.
$db->query(
"UPDATE `Mining`
SET `mEXP` = `mEXP` + $expgain
WHERE `userid` = $userid");
break;
I would remove the echo, item_add, and query and add them after the select case like this:
if($flakes <> 0 && $expgain <> 0)
{
echo "While mining away, you have uncovered {$flakes} Silver Flakes!";
item_add($userid, $silverflakesid, $flakes); //Replace 68 with your Silver Flakes item ID.
$db->query(
"UPDATE `Mining`
SET `mEXP` = `mEXP` + $expgain
WHERE `userid` = $userid");
}
I would also move around other repetitive stuff.