Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Addons/Mods Graveyard (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=41)
-   -   Cash System (http://www.mysidiaadoptables.com/forum/showthread.php?t=1127)

Seapyramid 10-07-2009 07:33 PM

Cash System
 
OK.. I suck at tutorials but I will give this a try

Find
PHP Code:

                     if ($newclicks >= $requiredclicks and $requiredclicks != 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

Bloodrun 10-08-2009 07:49 AM

RE: Cash System
 
Very nice seapyramid =D

This will even work with the next release of the forum, as it gives points for posts and what not which could be "converted" into "money".

arlecchina 10-08-2009 02:31 PM

RE: Cash System
 
Thanks so much for posting this Sea.

Seapyramid 10-08-2009 02:32 PM

RE: Cash System
 
Thank you & all are quite welcome.

Sea

Tequila 10-22-2009 09:43 AM

RE: Cash System
 
I just installed this, it wasn't even that bad. :) You did a great job on this Sea. Nice and easy.

Seapyramid 10-22-2009 12:57 PM

RE: Cash System
 
Quote:

Originally Posted by enddayne
I just installed this, it wasn't even that bad. :) You did a great job on this Sea. Nice and easy.

Thank you :)

Tequila 10-23-2009 08:46 AM

RE: Cash System
 
I just came across an idea to show how much money a user has on their profile & in their sidefeed menu. What variable would I need to use for that?

Haylzee 10-30-2009 12:55 AM

RE: Cash System
 
Thanks, this works really well. :)

Now to figure out what to use the currency for lol.

Seapyramid 10-30-2009 01:36 AM

RE: Cash System
 
rolf.. I do have a few games that are generic the can can be used on by those with a bit of knowledge... items systems are quite personalized to the site so I cant help you there. :)

Sea

Haylzee 10-30-2009 01:49 AM

RE: Cash System
 
lol well I managed to show the currency on profiles so at the moment it can just be used to show who clicks the most pets. :D


All times are GMT -5. The time now is 02:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.