Hey,Guest we see you didn't join yet?
Click Register to register,Or login to login to the forums.
We hope you have a great time on our forums.

Join the forum, it's quick and easy

Hey,Guest we see you didn't join yet?
Click Register to register,Or login to login to the forums.
We hope you have a great time on our forums.

Would you like to react to this message? Create an account in a few clicks or log in to continue.

4 posters

    Shop restock.

    i just did
    i just did
    Moderators
    Moderators


    Number of posts : 562
    Rep: : 32
    Registration date : 2009-03-14
    Age : 32

    Shop restock. Empty Shop restock.

    Post  i just did Sat Mar 21, 2009 4:13 am

    A little change nothing more.


    Open up ShopHandler.java.

    and search:

    Code:

    public static int MaxShowDelay = #;


    Change the # for how fast the shop gotta restock. Just pick between 1-100.

    then search:

    Code:

    public void process() {

    You'll see something like this.

    Code:

       public void process() {
          boolean DidUpdate = false;
          for (int i = 1; i <= TotalShops; i++) {
             for (int j = 0; j < MaxShopItems; j++) {
                if (ShopItems[i][j] > 0) {
                   if (ShopItemsDelay[i][j] >= MaxShowDelay) {
                      if ((j <= ShopItemsStandard[i])
                            && (ShopItemsN[i][j] <= ShopItemsSN[i][j])) {
                         if (ShopItemsN[i][j] < ShopItemsSN[i][j]) {
                            ShopItemsN[i][j] += #; // if amount lower then
                                              // standard, increase it
                                              // !
                         }
                      } else {
                         DiscountItem(i, j);
                      }
                      ShopItemsDelay[i][j] = 0;
                      DidUpdate = true;
                   }
                   ShopItemsDelay[i][j]++;
                }
             }


    Change # for how many the shop need to restock ( 100, 1000 ect. )


    Save and compile.


    Q: Why i made this?
    A: Because people still whine about server restarts.
    avatar
    Elixer
    newby
    newby


    Number of posts : 30
    Rep: : 0
    Registration date : 2009-03-14

    Shop restock. Empty Re: Shop restock.

    Post  Elixer Sat Mar 21, 2009 2:24 pm

    Looks pretty nice. I used to code servers but forgot. If i code another ill surely remember.
    i just did
    i just did
    Moderators
    Moderators


    Number of posts : 562
    Rep: : 32
    Registration date : 2009-03-14
    Age : 32

    Shop restock. Empty Re: Shop restock.

    Post  i just did Sun Mar 22, 2009 5:38 am

    Elixer wrote:Looks pretty nice. I used to code servers but forgot. If i code another ill surely remember.

    Awesome ^^.

    Go for it in the mean time you play this ^^
    avatar
    pkerr
    newby
    newby


    Number of posts : 19
    Rep: : 2
    Registration date : 2009-03-24

    Shop restock. Empty Re: Shop restock.

    Post  pkerr Wed Apr 01, 2009 10:39 am

    kewl
    Drum Bass
    Drum Bass
    super poster
    super poster


    Number of posts : 362
    Rep: : 9
    Registration date : 2009-03-27
    Age : 30
    Location : England

    Shop restock. Empty Re: Shop restock.

    Post  Drum Bass Thu Apr 02, 2009 4:26 pm

    some arnt restoking or going back to amount 1,000
    i just did
    i just did
    Moderators
    Moderators


    Number of posts : 562
    Rep: : 32
    Registration date : 2009-03-14
    Age : 32

    Shop restock. Empty Re: Shop restock.

    Post  i just did Sat Apr 04, 2009 4:00 am

    You sure? what shops?

    Sponsored content


    Shop restock. Empty Re: Shop restock.

    Post  Sponsored content


      Current date/time is Fri May 10, 2024 12:45 pm