Author Topic: Rob The Bank - new item  (Read 24886 times)

Offline tazpot

Re: Rob The Bank - new item
« Reply #15 on: October 08, 2006, 04:54:30 am »
Excellent piece of work chadk i have been looking for something like this for a long. My members are so excited  :D

Offline Albadon

Re: Rob The Bank - new item
« Reply #16 on: October 08, 2006, 05:50:36 am »
Hi there! This is my first post in this forum. I would like to express my total satisfaction about SMFshop. It is a GREAT mod. Excellent work Daniel!

About this item now... I can't get it to work. I get the following whe uploading it:

Code: [Select]
Fatal error: Cannot instantiate non-existent class: item_robbank in /home/examino/public_html/forum/Sources/shop/ShopAdmin.php(174) : eval()'d code on line 1
I succesfully installed Armageddon for instance. Tha sounds a little weird to me. Is it?


Offline chadk

Re: Rob The Bank - new item
« Reply #17 on: October 08, 2006, 05:54:11 am »
Albadon: make sure you save the file as:
RobTheBank.php

Offline Albadon

Re: Rob The Bank - new item
« Reply #18 on: October 08, 2006, 06:05:51 am »
Yeap! That did it! What a full not to see the problem before posting. Anyway, thank you chadk.

Offline Daniel15

Re: Rob The Bank - new item
« Reply #19 on: October 08, 2006, 10:48:52 am »
Indeed, you must save the item with the correct name, as it gets the class name based on the file name. If you name it 'robbank.php', it will be looking for an item class called item_robbank (like in your error above). However, the class is actually called item_RobTheBank ;)

Offline chadk

Re: Rob The Bank - new item
« Reply #20 on: October 09, 2006, 09:16:40 am »
Now we'll see how excited your members are when the ROB the bank.. muahhahaha Mine haven't even tried since I changed the negative side effects of failure.

Offline tazpot

Re: Rob The Bank - new item
« Reply #21 on: October 12, 2006, 07:29:03 am »
chadk  how would i go about changing the negative side effects so that it empties there inventory but only removes a % of their credits not all of them?

Offline Daniel15

Re: Rob The Bank - new item
« Reply #22 on: October 13, 2006, 07:24:08 pm »
Quote
chadk  how would i go about changing the negative side effects so that it empties there inventory but only removes a % of their credits not all of them?

Change:

$result 
db_query("UPDATE {$db_prefix}members
SET karmaBad = karmaBad + 100, 
money = -100, moneyBank = -500
WHERE ID_MEMBER = 
{$ID_MEMBER}",
__FILE____LINE__);


To:

$result 
db_query("UPDATE {$db_prefix}members
SET karmaBad = karmaBad + 100, 
money = (money * 0.2), moneyBank = -500
WHERE ID_MEMBER = 
{$ID_MEMBER}",
__FILE____LINE__);


Change the 'money = (money * 0.2)' to whatever you want. money = (money * 0.2) means to set the amount of money to 20% of the original amount.

Offline tazpot

Re: Rob The Bank - new item
« Reply #23 on: October 14, 2006, 04:06:58 am »
 O0  Cheers daniel that is perfect. I think the losing all money scared a few people so i will try it at 50%  O0

Offline Albadon

Re: Rob The Bank - new item
« Reply #24 on: October 15, 2006, 11:21:11 pm »
Now we'll see how excited your members are when the ROB the bank.. muahhahaha Mine haven't even tried since I changed the negative side effects of failure.

LOL. I guess they are gonna kill me! LOL!

Offline tazpot

Re: Rob The Bank - new item
« Reply #25 on: November 12, 2006, 08:44:45 pm »
When someone robs the bank i get a PM telling me the bank was robbed and by how much but it is missing the name of who commited the crime?

here is the send PM code:
Code: [Select]
sendpm($pmto, 'Bank Robbed!', "{$user} Robbed the bank for {$steal_amount}", 0, $pmfrom);
                return "You FLEECED THE BANK for $steal_amount bags of wool!  Thief! Your Karma is STILL reduced by 10! (Karma isn't blind!)";

have i done something is there another reason?

Offline Edwin

Re: Rob The Bank - new item
« Reply #26 on: December 11, 2006, 03:46:42 am »
This one should go in /Sources/shop ?

I can't find it in the drop-down menu for the shop items

Offline feeble

Re: Rob The Bank - new item
« Reply #27 on: December 11, 2006, 10:33:32 am »
This one should go in /Sources/shop ?

I can't find it in the drop-down menu for the shop items

you need to copy the code in the first post and paste it in a file called RobTheBank.php (either create a txt file and change it to php or use dream weaver(or equivalent)
then upload that file to
/Sources/shop/items/

Offline jdv

Re: Rob The Bank - new item
« Reply #28 on: March 22, 2007, 10:41:38 am »
Can i get the rob the bank item coded where it has no effect on karma whether your successful or not. I want to keep karma out of it. You either steal money or you you dont. Also where you dont lose all your money just because you were unsuccessful. Its either you successful or not. Succesfful you rob the bank, your not succesfful, nothing happens.

I have tried and tried, but it keeps giving/taking karma. I want the item but without the karma being added/taken. Takes the money.

Thanks.
John

Offline MuNiX

Re: Rob The Bank - new item
« Reply #29 on: March 29, 2007, 02:19:49 am »
When someone robs the bank i get a PM telling me the bank was robbed and by how much but it is missing the name of who commited the crime?
Change:
global $user;   
To: 
global $user_info;

Change:
Code: [Select]
        $pmfrom = array(
            'id' => 1,
            'name' => 'Chad',
            'username' => 'Chad'
        );
To:
Code: [Select]
$pmfrom = array(
            'id' => $ID_MEMBER,
            'name' => $user_info['name'],
            'username' => $user_info['username']
        );

And Change this:
Code: [Select]
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!)";
To:
Code: [Select]
sendpm($pmto, 'Bank Robbed!', "{$user_info['name']} 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!)";

 ;)