OK.. I suck at tutorials but I will give this a try
Find
PHP Code:
if ($newclicks >= $requiredclicks and $requiredclicks != 0 and $requiredclicks != "") {
// We need to level this adoptable up...
$query = "UPDATE " . $prefix . "owned_adoptables SET currentlevel='" . $nextlevel . "' WHERE aid='" . $id . "'";
mysql_query($query);
// Now we check if we are enabling alternate images...
// Get the ID of the parent type adoptable
$parentid = converttypetoparentid($type);
// Check if we are using alternate images or not...
$altstatus = getaltstatus($parentid, $id, $nextlevel);
if ($altstatus == "yes") {
// We are enabling alternate images for this adoptable...
$query = "UPDATE " . $prefix . "owned_adoptables SET usealternates='yes' WHERE aid='" . $id . "'";
mysql_query($query);
}
// Now we can see if the adoptable's owner gets a reward...
// The reward function will take care of sending out any reward that exists...
$rewardstatus = reward($id, $type, $nextlevel, $owner);
}
// End the if statement if we are leveling the adoptable up
$image = getcurrentimage($id);
$article_title = "You just gave " . $name . " one Maturity Training.<br />";
$article_content = $article_content . "<br /><br />";
}
on your levelup.php page. Directly below it add
PHP Code:
// ************************************************
// Start Rewards
// ************************************************
//Get currency on level up
$query = "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
$result = mysql_query($query);
$num = mysql_numrows($result);
$i = 0;
while ($i < 1) {
$money = @mysql_result($result, $i, "money");
// Change this number 10 to the number of currency you want users to earn on level up
$newbalance = $money + 2;
$i++;
}
mysql_query("UPDATE `adopts_users` SET `money`='" . $newbalance . "' WHERE `username`='$loggedinname'");
$article_content = $article_content . "<div align='center'><br />You have earned 2 Gold Pieces for leveling up this Companion. <br />You now have " . $newbalance . " Gold Pieces.</div>";
on this line in the above script
PHP Code:
$newbalance = $money + 2;
is where you change the amount to whatever you want it to be.
You will have to modify your adopts_users table and add a new field called money
`money` int(11) NOT NULL default '0',
Lastly you will have to modify your register.php page
PHP Code:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0')");
If I didn't forget anything it should work.
Sea