Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2012, 04:17 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 7,799
schepers12 is on a distinguished road
Question will this code work? (sort of blacksmith idea)

hello all, i have a question, will this code work how it supposed to work?
(for example: take 10 gold powder away and add in most cases 2 gold coins, otherwise it's a failure..)
i'm just asking to be sure, as i don't really know how the MYS engine exactly works... ^^;;

the full php & html code:



GOT IT TO WORK, the working code is:
PHP Code:
<?php

include("functions/functions.php");
include(
"functions/functions_users.php");
include(
"functions/functions_adopts.php");
include(
"functions/functions_items.php");
include(
"classes/class_item.php");
include(
"inc/lang.php");

//***************//
//  START SCRIPT //
//***************//
$name1 "gold powder"// the item you want to give to the blacksmith
$amount1 "10"// the amount of the item you need to give to the blacksmith
$name2 "gold coins"// the name of the item you want to add by the blacksmith
$amount2 "2"//the amount of items you want to receive from the blacksmith
$userstatus getuserstatus($loggedinname);

if(
$isloggedin == "yes" and $userstatus['canshop'] == "yes"){
  if(
$_GET["act"] == "do"){
    
$item = new Private_Item($name1$loggedinname$quantity);
    if (
$item >= $amount1){
      
$chance rand(1,10);
      if (
$change 8){
        
$item = new Private_Item($name1$loggedinname$quantity);
        
$item2 = new Private_Item($name2$loggedinname$quantity);
        if(
$item->removeitem($amount1$loggedinname)){
          
$newquantity $oldquantity $amount1;
          
$item2->additem($amount2,$loggedinname);
          
$article_title "Success!";
          
$article_content "Success! {$amount1} of your {$name1} has been molten into {$amount2} pieces   of {$name2} !";
        } else {
          
$article_title "You don't have enough {$name1}!";
        }
      } else {
        
$oldquantity Private_Item::getoldquantity($name1$loggedinname);
        
$newquantity $oldquantity $amount1;
        
$article_title "failure!";
        
$article_content "the melting has gone wrong sadly, all of the {$name1} has gone to waste..";
      }
    } else {
        
$article_title "You don't have enough {$name1}!";
    }
  } else{
    
$article_title "Confirm your action";
    
$article_content "Melt your {$name1} to {$name2}. you need {$amount1} of {$name1} to get {$amount2} pieces of {$name2}.<br>There is a change of failure though!
    <form name='do' method='post' action='blacksmith.php?act=do'>
    <input name='itemname' type='hidden' id='itemname' value='
{$item}'><p><input type='submit' name='do' value='Make {$name2}'></p></form>"
  }
}else{
    
$article_title $accden;
    
$article_content $reqlogin;
// End is logged in check else
//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title$article_content$date);

?>

Last edited by schepers12; 09-24-2012 at 05:26 AM. Reason: got it to work myself!
Reply With Quote
  #2  
Old 10-16-2012, 10:41 PM
ShadowedFortune ShadowedFortune is offline
Member
 
Join Date: Aug 2012
Posts: 7
Gender: Female
Credits: 951
ShadowedFortune is on a distinguished road
Default

This is awesome! Is it alright if I use this for my site?
You want credit or anything?
Reply With Quote
  #3  
Old 11-14-2012, 04:48 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 7,799
schepers12 is on a distinguished road
Default

go ahead and use it as you wish~ =)
__________________
~
Reply With Quote
Reply

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
Mys v1.3.1 Group sort StarGirl Mys v1.3.x Mods 60 09-17-2018 04:46 AM
1.3.4 - group sort draugluin Questions and Supports 6 01-16-2017 12:02 PM
Invite Code/Alpha Code Shex Questions and Supports 0 03-07-2011 04:08 AM
sort adoptables Blackmagic Questions and Supports 3 12-01-2009 03:05 PM
bb code idea aroymart Suggestions and Feature Requests 2 01-20-2009 05:46 PM


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

Currently Active Users: 461 (0 members and 461 guests)
Threads: 4,080, Posts: 32,024, 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