Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • stCky: idk man im just a chat bot
      August 22, 2017, 11:14:52 PM
    • symantec: is this forum
      August 22, 2017, 09:02:56 PM
    • symantec: what the fudge
      August 22, 2017, 09:02:52 PM
    • symantec: I just joined to download datmaker, the links are broken and a user named i nelson i has a fudgeing weird signature
      August 22, 2017, 08:59:33 PM
    • stCky: ur so cool and edgy
      August 22, 2017, 04:15:50 PM
    • Deathspirit: anyways, i'm un ip banned now.. but don't even want to be that at this point lmfao
      August 22, 2017, 01:58:14 PM
    • Deathspirit: now it's some sell out half leeched server :')
      August 22, 2017, 01:57:53 PM
    • Deathspirit: gf moparscape, was the best rsps community i've been on since 2006
      August 22, 2017, 01:57:31 PM
    • stCky: yeah, nah. it's cooked. [link] might help u with a backup or something idk man im just a chat bot
      August 22, 2017, 12:13:25 AM
    • flew420: I sure hope someone has a copy of the forum before it was recked
      August 21, 2017, 11:40:52 PM
    • flew420: O wow i see now, just read thru all the news articles. :(  i've been out of the game for a couple years so coming back to this shit is sad.
      August 21, 2017, 11:39:46 PM
    • flew420: Huh?
      August 21, 2017, 10:49:51 PM
    • stCky: got bought by a russian dude, he put a shitty rsps on it for donations, now no one cares
      August 21, 2017, 10:48:30 PM
    • flew420: I came on for some nostalgic reading in old classic development, and it only goes back to 2014 wtf.
      August 21, 2017, 10:43:09 PM
    • flew420: what happened to this site??
      August 21, 2017, 10:42:36 PM
    • Sean56:[link]
      August 21, 2017, 05:33:45 PM
    • kb010: how can i play? i downloaded the client and it doesnt open.
      August 21, 2017, 10:52:56 AM
    • wodkode: shut it down or fix it
      August 20, 2017, 10:11:28 PM
    • wodkode: dude i cant goto no links on here from google
      August 20, 2017, 10:11:13 PM
    • Dell: Greetings
      August 20, 2017, 11:56:30 AM

    Author Topic: [PI] Shops - Using Donor Points [TUT]  (Read 14307 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    [PI] Shops - Using Donor Points [TUT]
    « on: March 20, 2012, 10:40:13 PM »
    Hello,

    As the poll question of my other tut passed.
    Well, here is a little tutorial on making donator shops, pk shops, using points instead of coins.
    Here is the tutorial on how to add Donor Points: #msg3802185


    Step 1:Adding Shop.

    1- Open Shops.cfg and look which id is coming next.
    you will see something like this:
    Quote
    //-----ShopID---ShopName---
    shop = 1
    shop = 2
    shop = 3
    ....
    So, if your last shop id is 18 you will go ahead and add a new line with the shop id 19. Like this:
    Code: [Select]
    shop = 19Donator_Store22104010"1040" = item id, "10" = amount in shop. To add more items, add the item id's you want and add their amount like so.
    Code: [Select]
    shop = 19Donator_Store22104010      1042     10      1044      10

    2- Go into ActionHandler.java and add a the NPC.
    Code: [Select]
    case 240:
    c.getShops().openShop(19);
    break;
    "case 1111" is the NPC which will handle the shop.
    "c.getShops().openShop(19);" means that it will open our shop id 19 from Shops.cfg.


    3- Put your NPC in-game.
    Open Spawn-Config.cfg and add a new line like this one:
    Code: [Select]
    spawn = 240 XXXXYYYY00000Description...This will spawn the NPC 240 in your server. Edit your "XXXX" & "YYYY" by the position you want them to be.

    Ok, now your shop is added and you have some items into it! :D
    Right, so now let's go ahead and put these items prices..



    Step 2:Adding Price.

    So now, you want to be able to buy your items with your points..

    1- Open ShopAssistant.java and search something like this:
    Code: [Select]
    public void buyFromShopPriceunder this add:
    Code: [Select]
    if (c.myShopId == 19) {
    c.sendMessage(c.getItems().getItemName(removeId)+": currently costs " + getSpecialItemValue(removeId) + " Donor Points.");
    return;
    }
    This means when the player will click on the item in the shop, it will give him the price in Donor Points.


    2- Changing the item price.
    In ShopAssistant.java again, look something like this:
    Code: [Select]
    public int getSpecialItemValueand add this:
    Code: [Select]
    case 1040:
    return 15;
    This means your item id "1040" will cost 15 Donor Points.
    NOTE, each items you've added in your donator shop into shops.cfg, You have to declare them there also.


    3- in ShopAssistant.java again, Search for:
    Code: [Select]
    public void handleOtherShopand right after this add:
    Code: [Select]
    } else if (c.myShopId == 19) {
    if (c.donorPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.donorPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("You do not have enough Donor Points to buy this item.");
    }
    }
    }
    this will make your items buyable with your points..

    4- in ShopAssistant.java search for:
    Code: [Select]
    int Slot = 0;
    under this, you'll see something like this:
    Code: [Select]
    if (c.myShopId >= XX) {
    handleOtherShop(itemID);
    return false;
    }

    right after this add:

    Code: [Select]
    if (c.myShopId == XX) {
    handleOtherShop(itemID);
    return false;
    }
    NOTE* Replace the XX by your shop Id.
    This will declare your shop and will use the actual donor points.

    That's it,
    if you have any errors just post them here and we'll see.

    Sorry from my bad grammer, i'm not english guy. Trying my best.
    « Last Edit: April 10, 2012, 06:21:56 PM by dzeko »
    Currently working on


    OfflineJavaTC

    • Member
    • ****
    • Posts: 2,821
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Points [TUT]
    « Reply #1 on: March 21, 2012, 12:30:30 AM »
    Isn't there already a tutorial for this?
    Going to college fall 2014 for computer science.

    Back to posting.

    OfflineRuby

    • Member
    • ****
    • *
    • *
    • Posts: 6,834
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Points [TUT]
    « Reply #2 on: March 21, 2012, 06:52:13 AM »
    Isn't there already a tutorial for this?
    Shreddology.

    Toms guilty pleasure: http://i.imgur.com/bmWqw7v.png


    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Points [TUT]
    « Reply #3 on: March 21, 2012, 06:52:59 AM »
    Isn't there already a tutorial for this?

    well, i dont really know if there is already a tutorial for this.
    but this tut is like the "part 2" of my first guide on how to add donor points.
    As they voted yes in the poll question..
    Currently working on

    Offlinesjoger

    • Member
    • **
    • Posts: 16
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #4 on: March 21, 2012, 10:51:54 AM »
    74 Errors  :confused:

    OfflineElementalz-X

    • Member
    • ***
    • Posts: 119
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #5 on: March 23, 2012, 04:16:42 PM »
    Nice dude, it helped thanks.
    Join Oberon Here: Click HERE

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #6 on: March 23, 2012, 05:36:10 PM »
    74 Errors  :confused:
    you did something wrong..
    Currently working on

    OfflineProjectPvpTehe

    • Member
    • **
    • Posts: 42
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #7 on: March 24, 2012, 01:41:43 AM »
    The shop shows that it costs Donar Points ect but it takes Gp I followed guide and all.
    « Last Edit: March 24, 2012, 02:11:37 AM by ProjectPvpTehe »

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #8 on: March 24, 2012, 08:38:58 AM »
    paste your shopassistant.java code here and send it here.
    « Last Edit: March 24, 2012, 08:40:39 AM by dzeko »
    Currently working on

    Offlinemr extremez

    • Member
    • ****
    • Posts: 3,048
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #9 on: March 24, 2012, 09:21:17 AM »
    A tutorial is not needed for this lol... Thanks for trying.

    Offlinelouisdemon

    • Member
    • **
    • Posts: 55
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #10 on: March 24, 2012, 01:03:05 PM »
    Code: [Select]
    src\server\model\shops\ShopAssistant.java:622: cannot find symbol
    symbol  : variable donorPoints
    location: class server.model.players.Client
                                    if (c.donorPoints >= getSpecialItemValue(itemID)
    ) {
                                         ^
    src\server\model\shops\ShopAssistant.java:624: cannot find symbol
    symbol  : variable donorPoints
    location: class server.model.players.Client
                                                    c.donorPoints -= getSpecialItemV
    alue(itemID);
                                                     ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors


    Here's what i added

    Code: [Select]
    public void handleOtherShop(int itemID) {

    if (c.myShopId == 18) {
    if (c.pcPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.pcPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("<col=255><shad=4000>You do not have enough PC points to buy this item.");
    }

    }
                            if (c.myShopId == 21) {
                                    if (c.donorPoints >= getSpecialItemValue(itemID)) {
                                            if (c.getItems().freeSlots() > 0){
                                                    c.donorPoints -= getSpecialItemValue(itemID);
                                                    c.getItems().addItem(itemID,1);
                                                    c.getItems().resetItems(3823);
                                            }
                                    } else {
                                            c.sendMessage("<col=255><shad=4000>You do not have enough Donor Points to buy this item.");                       
                                    }
                            }

    Help me please!
    « Last Edit: March 24, 2012, 01:10:49 PM by louisdemon »

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #11 on: March 25, 2012, 09:56:24 AM »
    did you added the donor points?.. -_-
    Currently working on

    Offlinek1ng0frs

    • Member
    • ****
    • Posts: 1,030
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #12 on: March 25, 2012, 10:11:07 AM »
    Code: [Select]
    src\server\model\shops\ShopAssistant.java:622: cannot find symbol
    symbol  : variable donorPoints
    location: class server.model.players.Client
                                    if (c.donorPoints >= getSpecialItemValue(itemID)
    ) {
                                         ^
    src\server\model\shops\ShopAssistant.java:624: cannot find symbol
    symbol  : variable donorPoints
    location: class server.model.players.Client
                                                    c.donorPoints -= getSpecialItemV
    alue(itemID);
                                                     ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors


    Here's what i added

    Code: [Select]
    public void handleOtherShop(int itemID) {

    if (c.myShopId == 18) {
    if (c.pcPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.pcPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("<col=255><shad=4000>You do not have enough PC points to buy this item.");
    }

    }
                            if (c.myShopId == 21) {
                                    if (c.donorPoints >= getSpecialItemValue(itemID)) {
                                            if (c.getItems().freeSlots() > 0){
                                                    c.donorPoints -= getSpecialItemValue(itemID);
                                                    c.getItems().addItem(itemID,1);
                                                    c.getItems().resetItems(3823);
                                            }
                                    } else {
                                            c.sendMessage("<col=255><shad=4000>You do not have enough Donor Points to buy this item.");                       
                                    }
                            }

    Help me please!
    You Forgot to Declare the Int
    fudgeing dead.

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #13 on: March 27, 2012, 09:14:18 PM »
    yep..
    Currently working on

    Offlineschoolrune

    • First Time Poster
    • *
    • Posts: 3
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #14 on: April 06, 2012, 11:56:55 PM »
    ive done everything even add donor points liek your other tutorial EVERYthing works

    But when i add my shop and set the items price (E.G 100 donor points)

    it spends 100 coins and does'nt get rid of the coins i want to make it get rid of the donor points

    help :)

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #15 on: April 10, 2012, 07:30:38 AM »
    ive done everything even add donor points liek your other tutorial EVERYthing works

    But when i add my shop and set the items price (E.G 100 donor points)

    it spends 100 coins and does'nt get rid of the coins i want to make it get rid of the donor points

    help :)

    in ShopAssistant.java search for:
    Code: [Select]
    int Slot = 0;
    under this, you'll see something like this:
    Code: [Select]
    if (c.myShopId >= XX) {
    handleOtherShop(itemID);
    return false;
    }
    right after this add:
    Code: [Select]
    if (c.myShopId == XX) {
    handleOtherShop(itemID);
    return false;
    }
    NOTE* Replace the XX by your shop Id.
    Currently working on

    Offlinenikolaww3

    • Member
    • ***
    • Posts: 224
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #16 on: April 10, 2012, 03:20:06 PM »
    Really nice and good tutorial but that last part
    Code: [Select]
                            } else if (c.myShopId == 19) {
                                    if (c.donorPoints >= getSpecialItemValue(itemID)) {
                                            if (c.getItems().freeSlots() > 0){
                                                    c.donorPoints -= getSpecialItemValue(itemID);
                                                    c.getItems().addItem(itemID,1);
                                                    c.getItems().resetItems(3823);
                                            }
                                    } else {
                                            c.sendMessage("You do not have enough Donor Points to buy this item.");                       
                                    }
                            }
                    }
    i got like 82 errors from that

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #17 on: April 10, 2012, 06:18:01 PM »
    send your:
    Code: [Select]
    public void handleOtherShop(int itemID) {complete method please
    Currently working on

    Offlinenikolaww3

    • Member
    • ***
    • Posts: 224
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #18 on: April 10, 2012, 06:56:37 PM »
    Code: [Select]
    public void handleOtherShop(int itemID) {     

    if (c.myShopId == 18) {
    if (c.pkPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.pkPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("You do not have enough cpk points to buy this item.");
    }

    }
    and the list goes on

    Offlinedzeko

    • Member
    • ****
    • Posts: 355
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Shops - Using Donor Points [TUT]
    « Reply #19 on: April 10, 2012, 07:01:26 PM »
    should look like so:
    Code: [Select]
    public void handleOtherShop(int itemID) {
    if (c.myShopId == 17) {
    if (c.magePoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.magePoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("You do not have enough points to buy this item.");
    }
    } else if (c.myShopId == 18) {
    if (c.pcPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.pcPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("You do not have enough points to buy this item.");
    }
    } else if (c.myShopId == 9 || c.myShopId == 10) {
    if (c.donorPoints >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0){
    c.donorPoints -= getSpecialItemValue(itemID);
    c.getItems().addItem(itemID,1);
    c.getItems().resetItems(3823);
    }
    } else {
    c.sendMessage("You do not have enough Points to buy this item.");
    }
    }
    }

    you might have forget a bracket..
    Currently working on

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal