Thread: Mys 1.3.4 Second Currency Mod
View Single Post
  #5  
Old 06-01-2017, 06:39 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 5,945
Fox is on a distinguished road
Default

Now, if you followed Abronsyth's adopt shop with conditions, you should have a unique 'shop'.php and 'shop'view.php.

Open the 'shop'.php (whatever you decided to name it)
Find this:
PHP Code:
$cost $mysidia->db->select("adoptables", array("cost"), "type='{$adopt->getType()}'")->fetchColumn();
            
$moneyleft $mysidia->user->money $cost;

            if(
$moneyleft >= 0){ 
                
$mysidia->user->changecash(-$cost); 
And replace with:
PHP Code:
$premiumcost $mysidia->db->select("adoptables", array("premiumcost"), "type='{$adopt->getType()}'")->fetchColumn();
            
$gemsleft $mysidia->user->premiumcurrency $premiumcost;

            if(
$premiumcurrencyleft >= 0){ 
                
$mysidia->user->changegems(-$premiumcost); 
Now for the last step, open up the 'shop'view.php

Find:
PHP Code:
$cost = new Comment("{$adopts[$i]->getCost()} Mythirian Gold");
            
$costCell = new TCell;
            
$costCell->add($cost);
            
$costCell->setAlign(new Align("right"));            

            
$row->add($idCell);
            
$row->add($imageCell);
            
$row->add($typeCell);
            
$row->add($costCell);
            
$adoptTable->add($row);
        } 
And replace with:
PHP Code:
$premiumcost = new Comment("{$adopts[$i]->getPremiumCost()} Mythirian Gems");
            
$premiumcostCell = new TCell;
            
$premiumcostCell->add($premiumcost);
            
$premiumcostCell->setAlign(new Align("right"));            

            
$row->add($idCell);
            
$row->add($imageCell);
            
$row->add($typeCell);
            
$row->add($premiumcostCell);
            
$adoptTable->add($row);
        } 

And there you have it! A second currency and adopts to buy with it. I'll try to implement an item one too eventually.
Reply With Quote