Author Topic: New items: Red Balls  (Read 28014 times)

Offline jdv

Re: New items: Red Balls
« Reply #15 on: December 24, 2006, 02:55:51 am »
i got the following error after i tried using your shop item.

Parse error: parse error, unexpected '&', expecting ']'

Offline jdv

Re: New items: Red Balls
« Reply #16 on: December 24, 2006, 03:15:58 am »
line 59 is where the parse error was or indicated.

Offline Masterhand

Re: New items: Red Balls
« Reply #17 on: December 31, 2006, 12:42:20 pm »
Sorry about that, old browser added it, and its fixed.
~If at first you don't succed, hide all evidence that you tried.~ - Homer Simpson

Offline jdv

Re: New items: Red Balls
« Reply #18 on: December 31, 2006, 01:59:53 pm »
thanks.

redball one basically took 100 posts away from the person i threw it too.

as for redball2, i passed the ball and it said the person may or may not catch it. does anything happen beside that? they didnt get no pm or nothing and nothing follows whether the person caught it or not? i dont think redball2 is working.

Lucid_Dream

  • Guest
Re: New items: Red Balls
« Reply #19 on: January 03, 2007, 02:23:36 pm »
Hmm still works on my site.  Will have a quick look at it again

Offline cheesenub

Re: New items: Red Balls
« Reply #20 on: January 06, 2007, 04:37:42 am »
I don't think this is working. When I throw the ball, the person I throw it to doesn't receive it or gets a message about receiving it.

Also, when I try to throw the ball to myself, it doesn't give me the "You can't throw it to yourself tbh!!!" return.


This part looks a little weird to me:

$pmfrom = array(
'id' => 1,
'name' => 'Masterhand',
'username' => 'Masterhand'
);


Should this be changed to something else?
« Last Edit: January 06, 2007, 04:50:19 am by cheesenub »

Offline Masterhand

Re: New items: Red Balls
« Reply #21 on: January 12, 2007, 05:11:49 am »
Cheesenub; When your enter your username, it has to be the exact way you see it, not your display name..I think.

2: The reason why the PM isn't working is because this bit of code is disabled:

Code: [Select]
/*global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
*/
Because it gives errors.

If you want to try it, remove the /* and the */ .
Works fine for me....

~If at first you don't succed, hide all evidence that you tried.~ - Homer Simpson

babylonking

  • Guest
Re: New items: Red Balls
« Reply #22 on: January 22, 2007, 11:31:09 am »
Same problem here the PM is not working, I also added the code below and still is not sending PM.

Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');

Offline mikemotorcade

Re: New items: Red Balls
« Reply #23 on: January 31, 2007, 06:42:58 am »
So how do I download it?

Offline Masterhand

Re: New items: Red Balls
« Reply #24 on: March 06, 2007, 03:01:54 am »
Create a file called redball.php in your /shop/items directory. Then copy the code into the file.
After that, you add the item in your Shot ACP.
(Sorry about being away for a while, i was busy alot).
I will take a look at the code and see why the pm function is not working in Redball 2...
~If at first you don't succed, hide all evidence that you tried.~ - Homer Simpson

babylonking

  • Guest
Re: New items: Red Balls
« Reply #25 on: March 14, 2007, 12:14:50 am »
with the PM code below the RedBall is sending PM now  :)

Code: [Select]
<?php

/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2006 DanSoft Australia           |
|      http://www.dansoftaustralia.net/        |
\**********************************************/

//File: Redball2.php

// VERSION: 2.3 (Build 11)
// $Date: 2006-11-17 13:34:18 +1000 (Fri, 17 Nov 2006) $
// $Id: Redball2.php 24 2006-10-21 03:34:18Z Mh $
global $sourcedir;
require_once(
$sourcedir '/Subs-Post.php');
class 
item_Redball2 extends itemTemplate {
    
    function 
getItemDetails() {

$this->authorName "Masterhand";
                
$this->authorWeb "http://www.gameandcoders.uni.cc";
$this->authorEmail "austin.r.tanay@gmail.com";

          
$this->name "RedBall2";
          
          
$this->desc "Redball 2";
          
// The item's price
          
$this->price 100;

       
   
          
$this->require_input true;
         
          
$this->can_use_item true;
    }

    
      function 
getAddInput() {
        return 
"Max amount to give: <input type='text' name='info1' value='100'><br>
               Max amount to take: <input type='text' name='info2' value='-100'>"
;
    
}  


       function 
getUseInput() {
       
global 
$context$scripturl$settings$txt;
        return 
"Bounce To: <input type='text' name='stealfrom' size='50'>
         <a href='
{$scripturl}?action=findmember;input=stealfrom;quote=0;sesc={$context['session_id']}' onclick='return reqWin(this.href, 350, 400);'><img src='{$settings['images_url']}/icons/assist.gif' border='0' alt='{$txt['find_members']}' /> Find Member</a>";
    }
    
    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$user$item_info;
   
$pmfrom = array(
            
'id' => 1,
            
'name' => 'Admin',
            
'username' => 'Admin'
        
);
        
        
$pmto = array(
            
'to' => array($_POST['stealfrom']),
            
'bcc' => array()
        );
     
$result db_query("SELECT realName
                                FROM 
{$db_prefix}members
                                WHERE ID_MEMBER = 
{$ID_MEMBER}"__FILE____LINE__);
     
$row mysql_fetch_array($resultMYSQL_ASSOC);
$user $row["realName"];

       if (
$user == $_POST['stealfrom']) {
return 
"You cant throw it too yourself!";
die();
  }

else {
$amount mt_rand($item_info[2], $item_info[1]);

$result db_query("UPDATE {$db_prefix}members
                                SET money = money + 
{$amount}
                                WHERE realName = '
{$_POST['stealfrom']}'"__FILE____LINE__);
                                
sendpm($pmto'Heres a redball?'"<b>{$user}</b> Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message"0$pmfrom); ;
                                return 
"You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";

       
$result db_query("SELECT ID_MEMBER
       FROM 
{$db_prefix}members
       WHERE realName = '
{$_POST['stealfrom']}'"__FILE____LINE__);
       
$row mysql_fetch_array($resultMYSQL_ASSOC);


            }

  }
  }

?>

Offline Lew_Cipher

Re: New items: Red Balls
« Reply #26 on: March 16, 2007, 12:29:31 am »
Great item! I changed it around and turned it into passing a football for my sports-themed board. Thanks! O0

Offline Masterhand

Re: New items: Red Balls
« Reply #27 on: March 17, 2007, 03:10:46 am »
Thanks Bl; I'll update the first post right away.
@Lew_Cipher: Sounds great, could i have a link? (Im a sports fan)
~If at first you don't succed, hide all evidence that you tried.~ - Homer Simpson

Offline Lew_Cipher

Re: New items: Red Balls
« Reply #28 on: March 17, 2007, 07:16:54 am »
Thanks Bl; I'll update the first post right away.
@Lew_Cipher: Sounds great, could i have a link? (Im a sports fan)

You have a PM.

My members have been using this mod like crazy since I installed it.

Offline Jamie

Re: New items: Red Balls
« Reply #29 on: April 21, 2007, 07:20:06 am »
Its not working for me. I get "ERROR: Could not create instance of 'redball' item!" when I open the add/edit/delete items page