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
  #1  
Old 11-29-2009, 11:15 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 12,369
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
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 09:42 PM
Games With the Cash System redheadturkey Suggestions and Feature Requests 8 08-27-2010 03:37 AM
Cash System Ashje Questions and Supports 10 12-21-2009 03:55 PM
About the cash system Ben Suggestions and Feature Requests 10 10-07-2009 08:34 PM
Buying 'cash' with cash? Quillink Questions and Supports 4 07-20-2009 03:21 AM


All times are GMT -5. The time now is 03:44 PM.

Currently Active Users: 2219 (0 members and 2219 guests)
Threads: 4,081, Posts: 32,032, 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