Jump to content
MakeWebGames

Recommended Posts

Posted

I want it so if you cook a pizza, you get exp in the cooking skill. Now, the cooking skill is just like any other skill, so how would I make it so you get cooking exp when you make the pizza?

 

<?
include "globals.php";
if($ir['cooking']< 0)
{
print "You have to have at least 15 cooking level to make a pizza.";
$h->endpage();
exit;
}
if($ir['makepizza'] == 0)
{
die("Making a pizza without ingredients? It can't be done!");
}
else
{
if($ir['makepizza'] == 1)
{
//set $win prize winings
$win=rand(100,1700);
$loss=rand(10,276);
if(rand(1,30) <= 14)
{
print "

You successfully create a pizza, and gain $win cooking exp!";


}
else
{
if(rand(1,30) <= 15)
{
print "

You burn the pizza, you dont win anything, you lose $loss dollars!";
$db->query("UPDATE users SET money=money-$loss WHERE userid=$userid",$c);
}
else
{
if(rand(1,30) <= 5)
{
print "

You lose the dough![<u>[url='makepizza.php']Buy more dough[/url]</u>]";
$db->query("UPDATE users SET makepizza=0 WHERE userid=$userid",$c);


}
}
}
}
}
?>

 

It'd be the exact same as doing any other skill, like giving out strength or guard, but it's just called cooking. How do I do it?

Posted

Re: Skill exp?

You need to add cook to userstats in phpmyadmin.

(Note: when adjusting userstats in the db remember to fix registration for userstats)

Then add a query to update the userstats by a set/rand amount.

$gain= (*your set/rand equation*(x*WILL/x))

$db->query("UPDATE userstats SET cook=cook+$gain WHERE userid=$userid",$c);

Just an idea.. but should help u figure it out.

Also just fallow the gym.php seeing as that's what your trying to do but for cooking.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...