Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

Reply
 
Thread Tools Display Modes
  #11  
Old 11-18-2009, 12:59 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

Wow, this is awesome. :D
I just installed it (very easy to, thanks!) and it's working amazingly. I might add something so pets can be 'bought', is that okay? I'll share it on here, when I'm finished. :)
Reply With Quote
  #12  
Old 11-18-2009, 03:04 AM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 17,991
Seapyramid
Default RE: Cash System

Sure its ok :) Actaully I have a separte shop for that which also uses paypal ipn.. you might want to look at it http://mysticgrove.net/grove/shop_queen.php For just using the ingame coin to buy stuff I have http://mysticgrove.net/grove/shop_gnome.php for trinkets (kinda like mini pets I gues) & http://mysticgrove.net/grove/shop_merlin.php for useable items. I also currently have 3 gambling games in game coin can be used for with more planned :)

Much can be done with the coin system once it is in place :)

Sea
Reply With Quote
  #13  
Old 11-18-2009, 11:56 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

Ooh, awesome. :) I love how you have the trinket shop and stuff. :) I think that I'll work on the code when I have time, then. x3
Reply With Quote
  #14  
Old 11-19-2009, 08:34 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

I just made the thing to buy adoptables. It works well, except for I can't get it to set the price in the admin CP - it always defaults to then 10 that I've set. Here's what I did.
PHP Code:
<?

// FILE: admin.php
// okay, I'm a failure here. It only works if I insert it in phpmyadmin. help?
// After line 158 add:
    
<p>Price
    <
input name='price' type='text' id='price'>
    </
p>

// reminder to me: there's a good code for a style switcher on line 119-213

// FILE: nadopt.php
// After line 136 add:
    
$price $_POST["price"];
    
$price secure($price);
    
// Change line 243 (about) to:
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$price')");

// in the table adopts_adoptables, use the sql query. Change the '10' to your default adoptable price.
ALTER TABLE  `adopts_adoptablesADD  `priceINT10 NOT NULL DEFAULT  '10';

// we still have to alter two more things - the adopt.php page, and the doadopt.php page.
// FILE: adopt.php
// After line 96 add:
$price=@mysql_result($result,$i,"price");
// After line 152 add:
$price=@mysql_result($result,$i,"price");
// After line 174 add:
<p>I cost ".$price." coins!</p>
// And after line 179 add:
<input name='price' type='hidden' id='price' value='".$price."'>

// FILE: doadopt.php
// After line 102 add:
$price=@mysql_result($result,$i,"price");
// Insert this giant junk of code after:
$code rand(120000);
// Here's the code:
$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");
$newbalance $money $price;
$i++;
}

mysql_query("UPDATE `adopts_users` SET `money`='" $newbalance "' WHERE `username`='$loggedinname'");

$article_content $article_content "<div align='center'>Thanks for buying your adoptable! Now you have ".$newbalance." coins!</div>"

// I can't guarentee that this is right, but if you have any problems, please tell me. :D
?>
Reply With Quote
  #15  
Old 11-21-2009, 01:12 PM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

Sea, I hate to be annoying (xD) but have you any idea on the price of the adoptables not working? I thought I was following the same layout as other stuff, but somehow, I guess it isn't working. :P
Reply With Quote
  #16  
Old 11-22-2009, 02:15 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 17,991
Seapyramid
Default RE: Cash System

Sorry,

I have been very busy, we just put the script rewrite/opt code on line this morning & preparing all the changes & setting it live was a big task. :) I will try to look at the code this week. Right now, I am tweaking bugs with the new lease & starting on the new full featured trading system coming next.

Sea
Reply With Quote
  #17  
Old 11-22-2009, 02:34 PM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

Ooh, that sounds awesome! And scary, too.
The trading system sounds awesome, too.
Reply With Quote
  #18  
Old 11-30-2009, 12:15 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 9,805
Fireballchad
Default RE: Cash System

Hey Arianna I sort of got your cash thing working...
I will try to make a tut of what I did.
Yours worked sorta of but you missed a few things it needed...
I am currently trying to make it so if you dont have enough money then you cant buy it... As of right now it allows you to go negative...
PHP Code:
<?
//File admin.php
//After line 165 add:
<input name='cba' type='radio' value='pricenum'>
Only when users pay this much money
<
input name='price' type='text' id='price'>
<
br>

// FILE: nadopt.php
// After line 94 add: it will be this but with promo instead
    
$price $_POST["price"];
    
$price secure($price);
    
// Change line 243 (about) to: '$price' was added at the end
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$price')");

// in the table adopts_adoptables, use the sql query. 
ALTER TABLE  `adopts_adoptablesADD  `priceINT10 NOT NULL DEFAULT  'NULL';
// I Hand entered this into my data base Default should be NULL I don't know if
// 'NULL' will work or not but fix it if it doesn't

// we still have to alter two more things - the adopt.php page, and the doadopt.php page.
// FILE: adopt.php
// After line 63 (about) add:
$price $_GET["price"];
$price secure($price);
// After line 96 add:
$price=@mysql_result($result,$i,"price");
// After line 152 add:
$price=@mysql_result($result,$i,"price");
// After line 174 add:
<p>I cost ".$price." coins!</p>
// And after line 179 add:
<input name='price' type='hidden' id='price' value='".$price."'>

// FILE: doadopt.php
//After Line 75 (about) add:
$price $_GET["price"];
$price secure($price);
// After line 102 add:
$price=@mysql_result($result,$i,"price");
// Insert this giant junk of code after:
$id=@mysql_result($result,$i,"aid"); 


$i++;
}

// Here's the code:
$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");
$newbalance $money $price;
$i++;
}

mysql_query("UPDATE `adopts_users` SET `money`='" $newbalance "' WHERE `username`='$loggedinname'");

$article_content $article_content "<div align='center'>Thanks for buying your adoptable! Now you have ".$newbalance." coins!</div>"

// Credit goes to     Arianna I only helped fix some stuff... Still needs to be fixed!!!
?>
Reply With Quote
  #19  
Old 11-30-2009, 01:06 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 26,939
Arianna will become famous soon enough
Default RE: Cash System

Maybe just check if ($newcash>=0) and then determine it via elseif. :)
Reply With Quote
  #20  
Old 11-30-2009, 01:23 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 9,805
Fireballchad
Default RE: Cash System

PHP Code:
<?
//File admin.php
//After line 165 add:
<input name='cba' type='radio' value='pricenum'>
Only when users pay this much money
<
input name='price' type='text' id='price'>
<
br>

// FILE: nadopt.php
// After line 94 add: it will be this but with promo instead
    
$price $_POST["price"];
    
$price secure($price);
    
// Change line 243 (about) to: '$price' was added at the end
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$price')");


// Replace the orignal one of this with this new one.
if($cba != "always" and $cba != "promo"  and $cba != "pricenum" and $cba != "conditions"){
$error "You did not choose a valid scenario when this adoptable can be adopted.  Please go back and either select the Always option, the Promo option or the Conditions option.";
}
// add this after the other ones that look like it around line 169
//If we are using money to buy this, we should have a amount in the box...
if($cba == "pricenum" and $price == ""){
$error "You selected that this adoptable is available for adoption only with money, but you did not enter in a money amount.  Please go back and either change this setting or type in a valid amount.";
}
// in the table adopts_adoptables, use the sql query. 
ALTER TABLE  `adopts_adoptablesADD  `priceINT10 NOT NULL DEFAULT  'NULL';
// I Hand entered this into my data base Default should be NULL I don't know if
// 'NULL' will work or not but fix it if it doesn't

// we still have to alter two more things - the adopt.php page, and the doadopt.php page.
// FILE: adopt.php
// After line 63 (about) add:
$price $_GET["price"];
$price secure($price);
// After line 96 add:
$price=@mysql_result($result,$i,"price");
// After line 152 add:
$price=@mysql_result($result,$i,"price");
// After the $i++; } put this
 
$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");
                                          
                      
$i++;
                  }
                  if (
$money >= $price$get "<input type='submit' name='Submit' value='Get Me'>";
    else 
$get "Sorry Cant Get, Not Enough Coin!";
// After line 174 add:
<p>I cost ".$price." coins!</p>
<
div align='center'><br />You have  " . $money . " coins </div>
// And after line 179 add:
<input name='price' type='hidden' id='price' value='".$price."'>
// Delete 
<input type='submit' name='Submit' value='Get Me'>
//Add inplace of that
".$get."
// FILE: doadopt.php
//After Line 75 (about) add:
$price $_GET["price"];
$price secure($price);
// After line 102 add:
$price=@mysql_result($result,$i,"price");
// Insert this giant junk of code after:
$id=@mysql_result($result,$i,"aid"); 


$i++;
}

// Here's the code:
$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");
$newbalance $money $price;
$i++;
}

mysql_query("UPDATE `adopts_users` SET `money`='" $newbalance "' WHERE `username`='$loggedinname'");

$article_content $article_content "<div align='center'>Thanks for buying your adoptable! Now you have ".$newbalance." coins!</div>"

// Credit goes to     Arianna I only helped fix some stuff... WORKS NOW!!! I = Fireballchad
?>
Wow this is a messy tut.... sorry but I got it to take the submit button away when you don't have enough money.
Also in the admin you can change how much it cost to get the adoptable.
If you manage to install this it is wonderfull... or if someone does install it and makes a better tut that would be better!
you can see it work at Forumbuds
Also some of my code may be weird or not wonderful... because I am a very novice PHP coder lol.
Reply With Quote
Reply


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
secondary cash.. maximillion Questions and Supports 2 07-04-2011 10:42 PM
Games With the Cash System redheadturkey Suggestions and Feature Requests 8 08-27-2010 04:37 AM
Cash System Ashje Questions and Supports 10 12-21-2009 04:55 PM
About the cash system Ben Suggestions and Feature Requests 10 10-07-2009 09:34 PM
Buying 'cash' with cash? Quillink Questions and Supports 4 07-20-2009 04:21 AM


All times are GMT -5. The time now is 08:27 AM.

Currently Active Users: 726 (0 members and 726 guests)
Threads: 4,081, Posts: 32,029, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636