Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - chadk

Pages: 1 ... 3 4 [5]
61
General SMFShop Discussion / Re: ANY CODERS OUT THERE: WE WANT PET MOD
« on: September 28, 2006, 10:18:50 pm »
Basil, I think if anyone can do it, you can.  I've seen your shop on your site and it's impressive.  I'm not sure anyone, even Daniel, has the skill that you have when it comes to shop items.



(daniel, of course you do but you don't have the time)

Basil: is that enough?  My nose smells like poop now. ;)

62
General SMFShop Discussion / Re: Item Ideas
« on: September 28, 2006, 09:51:07 am »
Pets would be fun.  Someone do it. ;)

63
General SMFShop Discussion / Re: SMF-RPG-Shop-II_1-0
« on: September 28, 2006, 09:42:31 am »
This sounds promising.

64
Items / Other item ideas I'm working on
« on: September 28, 2006, 09:37:41 am »
My users have some more shop item ideas as well that I'm going to try to work on but they'll require sql table changes so I'll have to read up on how to write an actual package.  They want:
Items to purchase:
Protection from Theft
Reverse Theft (if the thief fails, they get to steal from the thief!)
Armageddon Insurance (if someone does Armageddon all or some of the users credits are returned)
Karmageddon Insurance (restores positive and/or negative karma in the event of Karmageddon)
Protect Custom Title

65
Items / Re: Rob The Bank - new item
« on: September 28, 2006, 02:15:32 am »
Maybe someone could update my second version to PM the admin with the user's NAME.  Currently it doesn't send anything because $user isn't populated.

66
Items / Re: Karma Bash item
« on: September 27, 2006, 03:54:11 am »
What prevents users from using this on themselves?

67
Items / Karmageddon
« on: September 27, 2006, 03:53:39 am »
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: Karmageddon.php
//      RESETS all user's karma to ZERO

//VERSION: 1.0 (Build 1)
//DATE: Sep 26th, 2006
// $Id: Karmageddon.php chadk $

class item_Karmageddon extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Chad";
$this->authorWeb "http://www.aviary.info/";
$this->authorEmail "generalchad@gmail.com";
        
$this->name "KARMAGEDDON!";
        
$this->desc "This will reduce EVERYONES KARMA BACK TO ZERO!!";
        
$this->price 5000;
        
        
$this->require_input false;
        
$this->can_use_item true;
    }

    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info;
        
        
$pmfrom = array(
            
'id' => 1,
            
'name' => 'Chad',
            
'username' => 'Chad'
        
);
        
        
$pmto = array(
            
'to' => array(1),
            
'bcc' => array()
        );

            
$result db_query("UPDATE {$db_prefix}members
                                SET karmaBad = 0, karmaGood = 0"
__FILE____LINE__);
            
$result db_query("DELETE FROM smf_log_karma");
sendpm($pmto'KARMAGEDDON!'"{$ID_MEMBER} reset everyones karma."0$pmfrom);
                return 
"Everyone has a clean slate.";
        }
    }


?>

68
Items / Armageddon
« on: September 27, 2006, 03:53:06 am »
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: Armageddon.php
//      RESETS the bank and all user's money to ZERO

//VERSION: 1.0 (Build 1)
//DATE: Sep 26th, 2006
// $Id: Armageddon.php chadk $

class item_armageddon extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Chad";
$this->authorWeb "http://www.aviary.info/";
$this->authorEmail "generalchad@gmail.com";

        
$this->name "ARMAGEDDON!";
        
$this->desc "This will reduce EVERYONES credits on hand AND in the bank to ZERO!!! EVERYONE!!!";
        
$this->price 100000;
        
        
$this->require_input false;
        
$this->can_use_item true;
    }

    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info;
        


            
$result db_query("UPDATE {$db_prefix}members
                                SET moneyBank = 0, money = 0"
__FILE____LINE__);

                return 
"Its the end of the world as they know it, and you feel fine.";
        }
}
?>

69
Items / Re: Change Member Group
« on: September 27, 2006, 03:23:38 am »
Nope, it looks to allow you to set which membergroup they can add themselves to when you add the item to your shop.

70
Items / Rob The Bank - new item
« on: September 27, 2006, 03:08:28 am »
This is a fun one.
I'd asked for the feature but didn't see if happening so I wrote it for all to enjoy. ;)

Attempt to rob the bank.
Success = you get between 20% and 80% of the banks total money, all users loose that percentage, you loose 10 karma.
Failure = you loose 100 karma, you loose all your credits.

I have mine set to 1000 credits to purchase and 20% chance to win, users on my site have lots of credits because I've backpaid everyone for past posts.

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: RobTheBank.php
//      % chance to steal from all members in the bank
// on success, awards robber between 20 and 80% of the sum of all bank accounts
// and reduces bank accounts accordingly and gives 10 negative karma.
// On failure, gives -100 karma and sets money and bank money to 0 for robber.

//VERSION: 1.0 (Build 1)
//DATE: Sep 26th, 2006
// $Id: RobTheBank.php chadk $

class item_RobTheBank extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Chad";
$this->authorWeb "http://www.aviary.info/";
$this->authorEmail "generalchad@gmail.com";
        
$this->name "Rob the bank!";
        
$this->desc "You can try to ROB THE BANK!  This gives you a CHANCE to steal a portion of the money from EVERYONES bank account!  Note: Karma is NOT BLIND!  Even if you rob the bank, there may be consequences!";
        
$this->price 1000;
        
        
$this->require_input false;
        
$this->can_use_item true;
    }

    
//see AddToPostCount.php for more infos
    
function getAddInput() {
        return 
"Probability of successful robbery: <input type='text' name='info1' value='10'>%";
    }

    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info$user;
        
        
$pmfrom = array(
            
'id' => 1,
            
'name' => 'Chad',
            
'username' => 'Chad'
        
);
        
        
$pmto = array(
            
'to' => array(1),
            
'bcc' => array()
        );

        
//get a random number between 0 and 100
        
$try mt_rand(0100);

        
//if successfull
        
if ($try $item_info[1]) {

            
//get stealee's money count
            
$result db_query("SELECT sum(moneyBank) as vault
                                FROM 
{$db_prefix}members"__FILE____LINE__);
            
$row mysql_fetch_array($resultMYSQL_ASSOC);

            
//get random amount between 0 and amount of money stealee has
            
$steal_amount 1-(mt_rand(10,60)/100);

            
//take this money away from stealee...
            
$result db_query("UPDATE {$db_prefix}members
                                SET moneyBank = moneyBank * 
{$steal_amount}"__FILE____LINE__);
            
//...and give to stealer (robber)

$steal_amount = ($steal_amount-1) * -$row['vault'];

            
$result db_query("UPDATE {$db_prefix}members
                                SET money = money + 
{$steal_amount}, karmaBad = karmaBad + 10
                                WHERE ID_MEMBER = 
{$ID_MEMBER}
                                LIMIT 1"
__FILE____LINE__);

sendpm($pmto'Bank Robbed!'"{$user} Robbed the bank for {$steal_amount}"0$pmfrom);
                return 
"You ROBBED THE BANK for $steal_amount!  Thief! Your Karma is STILL reduced by 10! (Karma isn't blind!)";


        } else {
            
//if reducing Karma doesn't work, replace
            //'karmaBad = karmaBad + 10' with 'karmaGood = karmaGood - 10'
$result db_query("UPDATE {$db_prefix}members
SET karmaBad = karmaBad + 100, 
money = -100, moneyBank = -500
WHERE ID_MEMBER = 
{$ID_MEMBER}",
__FILE____LINE__);
$result db_query("DELETE FROM {$db_prefix}shop_inventory
WHERE ownerid = 
{$ID_MEMBER}",
__FILE____LINE__);

sendpm($pmto'Bank Robbery Foiled!'"{$user} was BUSTED!"0$pmfrom);
return 
"Steal <b>unsuccessful!</b> You Karma is now reduced by 100!";
        }
    }
}

?>

Pages: 1 ... 3 4 [5]