SMF Shop
SMFShop => Completed Additions => Items => Topic started by: Masterhand on November 17, 2006, 09:49:19 am
-
Here are the 2 files for the Redball items - There fun,
I had fun making them too.
Redball
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2006 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: RedBall.php
// Item
// VERSION: 2.3 (Build 11)
// $Date: 2006-10-21 13:34:18 +1000 (Sat, 21 Oct 2006) $
// $Id: RedBall.php 24 2006-10-21 03:34:18Z MH $
class item_RedBall extends itemTemplate {
function getItemDetails() {
$this->authorName = "Masterhand";
$this->authorWeb = "GAC";
$this->authorEmail = "austin.r.tanay@gmail.com";
$this->name = "RedBall";
$this->desc = "Bounce It And See What it Does!";
$this->price = 200;
}
function getUseInput() {
global $context, $scripturl, $settings, $txt;
return "Bounce to: <input type='text' name='username' />
<a href='{$scripturl}?action=findmember;input=username;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><br />";
}
function onUse() {
global $db_prefix, $ID_MEMBER;
if (!isset($_POST['username']) || $_POST['username'] == '') die("ERROR: Please enter a username!");
$result = db_query("UPDATE {$db_prefix}members
SET posts = posts - 100
WHERE memberName = '{$_POST['username']}'",
__FILE__, __LINE__);
return "Uh-Oh, The Ball Bounced around, and {$_POST['username']}Missed it and it knocked him out, and he lost some of his post count by 100..Whoops..";
}
}
?>
Redball 2
<?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($result, MYSQL_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($result, MYSQL_ASSOC);
}
}
}
?>
-
You should change the code to make the target have a change to catch (and keep) the ball instead of missing. =)
-
See First Post For Files
-
Cool. =).
(Be warned, this code won't work, hoever, because you used a quote mark for the "can't", thus throwing off the rest of the code. Use '`' instead =P.)
-
:D No, won't work, says: Prase Error: enespected T_IF ....*sigh*
-
"$user = $row[‘memberName’]" doesn't have a semi colon ;-) (it should)
-
$user = $row["memberName"], Ok, i'll try that.
EDIT: Nope, Parse error: syntax error, unexpected T_IF in /home/***/public_html/forum/Sources/shop/items/Redball2.php on line 59
-
So you added the semi colon after that? Strange. You shouldn't be getting that error. =(
-
Yea, it is...
-
I tried to sort this out for you but only got this far
<?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 $
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, $item_info;
$result = db_query("SELECT memberName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$user = $row["memberName"];
if ($user == $_POST[‘stealfrom’]) {
return "You cant throw it too yourself tbh!!!";
die();
}
else {
$amount = mt_rand($item_info[2], $item_info[1]);
$result = db_query("UPDATE {$db_prefix}members
SET money = money + {$amount}
WHERE memberName = '{$_POST[‘stealfrom’]}'", __FILE__, __LINE__);
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST[‘stealfrom’]}'", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$pmfrom = array(
'id' => 1,
'name' => 'Masterhand',
'username' => 'Masterhand'
);
$pmto = array(
'to' => array($row['ID_MEMBER']),
'bcc' => array()
);
sendpm($pmto, 'Care For Some Ball?', "{$user} Bounces The Ball To You And You Lose ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom);
}
}
}
?>
Can add the item to the shop and buy but when i go to use it does this
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
ORDER BY mem.lngfile
LIMIT 0' at line 8
File: /home/sites/opiate2.com/public_html/forum/Sources/Subs-Post.php
Line: 739
Will look at it again l8r, ur only problem was some syntax errors from wat i saw. Sorry if i overstepped myself but i wanted this item on my site and thought i'd give it a tinker.
-
WHERE memberName = '{$_POST[‘stealfrom’]}'"
That doesn't look right... That ‘ and ’ should probably be single quotes ( ' )
-
Got it working. Full code below
<?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 $
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, $item_info;
$result = db_query("SELECT memberName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$user = $row["memberName"];
if ($user == $_POST[‘stealfrom’]) {
return "You cant throw it too yourself tbh!!!";
die();
}
else {
$amount = mt_rand($item_info[2], $item_info[1]);
$result = db_query("UPDATE {$db_prefix}members
SET money = money + {$amount}
WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
/*global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
*/
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$pmfrom = array(
'id' => 1,
'name' => 'Masterhand',
'username' => 'Masterhand'
);
$pmto = array(
'to' => array($row['ID_MEMBER']),
'bcc' => array()
);
sendpm($pmto, 'Heres a redball?', "{$user} Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); ;
}
}
}
?>
Thanks to Masterhand for this great item
-
Got it working. Full code below
<?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 $
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, $item_info;
$result = db_query("SELECT memberName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$user = $row["memberName"];
if ($user == $_POST[‘stealfrom’]) {
return "You cant throw it too yourself tbh!!!";
die();
}
else {
$amount = mt_rand($item_info[2], $item_info[1]);
$result = db_query("UPDATE {$db_prefix}members
SET money = money + {$amount}
WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
/*global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
*/
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$pmfrom = array(
'id' => 1,
'name' => 'Masterhand',
'username' => 'Masterhand'
);
$pmto = array(
'to' => array($row['ID_MEMBER']),
'bcc' => array()
);
sendpm($pmto, 'Heres a redball?', "{$user} Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); ;
}
}
}
?>
Thanks to Masterhand for this great item
Your welcome xD, and thank you! :)
-
Its no problem man, no need to give me credit, ur the one that coded it i just found the syntax error.
-
Ok, but thanks anyway.
-
i got the following error after i tried using your shop item.
Parse error: parse error, unexpected '&', expecting ']'
-
line 59 is where the parse error was or indicated.
-
Sorry about that, old browser added it, and its fixed.
-
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.
-
Hmm still works on my site. Will have a quick look at it again
-
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?
-
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:
/*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....
-
Same problem here the PM is not working, I also added the code below and still is not sending PM.
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
-
So how do I download it?
-
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...
-
with the PM code below the RedBall is sending PM now :)
<?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($result, MYSQL_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($result, MYSQL_ASSOC);
}
}
}
?>
-
Great item! I changed it around and turned it into passing a football for my sports-themed board. Thanks! O0
-
Thanks Bl; I'll update the first post right away.
@Lew_Cipher: Sounds great, could i have a link? (Im a sports fan)
-
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.
-
Its not working for me. I get "ERROR: Could not create instance of 'redball' item!" when I open the add/edit/delete items page
-
Its not working for me. I get "ERROR: Could not create instance of 'redball' item!" when I open the add/edit/delete items page
Check that you have given the item the right file name...look for a line in the file like:
//File: Redball2.php
That file would be named Redball2.php
-
are there images that go with this item, I saw 'assist.gif' mentioned in the code but no image, or a ball maybe?
-
I made this one:
-
so what happens with this? The members get a PM with this ball in it, and then have to respond?
is this what the 'assist.gif' is or is that something else?
-
The image I gave you just gets used in the shop buy screens...makes it look pretty.
To see what redball does why not just put it in your test forum and play with it?
assist.gif is a standard part of your forum...it's used all over the show. I'll post it for you and I'm sure you'll recognise it right away.
-
The image I gave you just gets used in the shop buy screens...makes it look pretty.
To see what redball does why not just put it in your test forum and play with it?
assist.gif is a standard part of your forum...it's used all over the show. I'll post it for you and I'm sure you'll recognise it right away.
lol yes that would be easier wouldnt it, rather than asking a bunch of dumb questions... but I can't access it at the moment unfortunately. :(
I had in my head that this had some kind of bouncing ball effect :D
-
I've got it (and redball 2) on a test forum of mine and you're welcome to play about with it there if that would help...holler via PM and I'll give you the details.
-
One of my members asked why they didn't receive any notification about the redball2. The one you throw it at get's the PM but the one who threw it doesn't know if he lost or wins ?
Could that be fixed in anyway ?
The items gets bought a lot so they must like it :)
-
With Redball 1 instead of it dropping the person's post count by 100 (like it says it goes) it gives them like 16,000 post counts.
I can't see where to adjust this in the php coding as it says it only does "100", and it adds the "I am a geek" in the post count itself. So what exactly is with this one?
-
I like this item alot. Very cool...
-
can someone please help me?
the redball.php is not sending any pms when my members use it = /
-
Redball doesn't send a PM (isn't meant to)...Redball 2 does...perhaps you're getting confused between them?
-
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying
so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
-
cool stuff
-
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying
so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
FIND:
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";
And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.
Think that could be done?
-
Looks like you worked hard on this but I want to know, what does this do exactly? Screenshots too please? Thanks.
-
Just like any mod the best way for you to know what it does is to put it on a test forum and try it out...you'll know more that way than any explanation or screenshot could give you.
-
Sorry, I've only got one forum. If you have a test forum setup I would like to see, if not oh well.
-
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying
so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
FIND:
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";
And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.
Think that could be done?
I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.
-
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying
so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
FIND:
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";
And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.
Think that could be done?
I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.
what do u mean?
do u mean you want it just say he gain
or just say he
or if he gain it says he gain and if he lost, it says he lost
can u give an example?
-
That's exactly what I mean. If the recipient lost credits, it should say he lost XX credits. If he gained credits, then it should say he gained XX credits. The message I get after I throw the ball should say that as well as the PM the recipient gets should also tell them whether they won or lost.
-
That's exactly what I mean. If the recipient lost credits, it should say he lost XX credits. If he gained credits, then it should say he gained XX credits. The message I get after I throw the ball should say that as well as the PM the recipient gets should also tell them whether they won or lost.
well... im not a PHP person, im more of a VB person.
Probaly there can be a check where if the number is negative it says lots, and if is positive it says gain. But i don't know how to do that yet. sorry.
-
I got a problem here. Says:
Parse error: syntax error, unexpected T_STRING in /home/*****/public_html/phorum/Sources/shop/items/Redball2.php on line 81 :(
-
Wow. I haven't really been here / coded with SMF in a long time. I have a few things I need to sort out first. Then I can fix up the code.
-
I think this would be more interesting to our users if instead of reducing their post count it took away xx amount of credits from them. Our users all tell me the same thing about karma and post count, "They mean nothing to us" is what they tell me, and "if anybody judges me and my writings by my post count or my karma then they are a fool" is also what they say.
So anyway, I wonder if there is a way to take away credits from user instead of dropping post count.
-
Should be easy enough.... replace "posts" with "money" or something like that.
-
Hi! I am getting this error with both of the redball scripts.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2
Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2
AND....
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2
Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2
-
Hi! I am getting this error with both of the redball scripts.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2
Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2
AND....
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2
Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2
Warning: Unexpected character in input: '\' Means that you put an invalid character into the input field. [I think]. Does that error happen after you hit submit? Also, what is the name of the user you're putting in if you are?
I think this would be more interesting to our users if instead of reducing their post count it took away xx amount of credits from them. Our users all tell me the same thing about karma and post count, "They mean nothing to us" is what they tell me, and "if anybody judges me and my writings by my post count or my karma then they are a fool" is also what they say.
So anyway, I wonder if there is a way to take away credits from user instead of dropping post count.
Redball2 does that :P.
-
Hi,
This may not be possible but I'll ask anyway, I was wondering if it's possible for members that catch it have the choice to throw it to someone else and so forth until someone drops the ball and every time someone catches the ball they earn money and every time it's dropped that member looses money and it has a different pm message when it's cached or dropped.
Thanks
Leon J. Fletcher
-
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying
so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
FIND:
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";
And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.
Think that could be done?
I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.
I too would also like to know how you change the code so it either says you gain the credits or you lose instead of both?
-
does this work on smf 2.0 rc2?
-
6.5 month bump ;)