Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 12-15-2014, 04:41 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 139,852
Kyttias is on a distinguished road
Default

What are:
  • the names of both your currencies? (VAR_A, VAR_B)
  • the name of the column you added to the shop table (which would be the same as the variable name you added to the top of the page)? (VAR_C)
  • the name of the column in the users table that holds the amount of the secondary currency? (VAR_D)

I was thinking it'd be something vaguely like this?
public function purchase(Item $item){
$mysidia = Registry::get("mysidia");
if($item->owner != $mysidia->user->username) Throw new NoPermissionException('Something is very very wrong, please contact an admin asap.');
else{

if ($VAR_C == "VAR_A") {
$item->quantity = $mysidia->input->post("quantity");
$cost = $item->getcost($this->salestax, $item->quantity);
$moneyleft = $mysidia->user->money - $cost;
if($moneyleft >= 0 and $item->quantity > 0){
$purchase = $item->append($item->quantity, $item->owner);
$mysidia->db->update("users", array("money" => $moneyleft), "username = '{$item->owner}'");
$status = TRUE;
}
else throw new InvalidActionException($mysidia->lang->money);
}
if ($VAR_C == "VAR_B") {
$item->quantity = $mysidia->input->post("quantity");
$cost = $item->getcost($this->salestax, $item->quantity);
$moneyleft = $mysidia->user->VAR_D - $cost;
if($moneyleft >= 0 and $item->quantity > 0){
$purchase = $item->append($item->quantity, $item->owner);
$mysidia->db->update("users", array("money" => $moneyleft), "username = '{$item->owner}'");
$status = TRUE;
}
else throw new InvalidActionException($mysidia->lang->money);
}

}
return $status;
}
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Second Currency and Currency icon Rovick Suggestions and Feature Requests 14 11-11-2014 05:29 PM
Secondary "RARE" cash option? Tequila Questions and Supports 4 09-17-2012 09:18 AM
secondary cash.. maximillion Questions and Supports 2 07-04-2011 09:42 PM
Mod: Currency Magnie Addons/Mods Graveyard 12 06-05-2010 10:05 AM
Currency Mod Killgore Questions and Supports 1 04-10-2009 08:04 PM


All times are GMT -5. The time now is 04:00 AM.

Currently Active Users: 3802 (0 members and 3802 guests)
Threads: 4,082, Posts: 32,047, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636