Author Topic: ItemonItem construction.  (Read 139 times)

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
ItemonItem construction.
« on: March 30, 2011, 02:47:01 pm »
I'm not really good with server sided coding iv just started learning.  im trying make a construction base and atm im using item on item method. its using firemaking skill atm.

Quote
         if ((itemUsed == 2347) && (useWith == 960)) {
            if (playerLevel[11] >= 0) {
               setAnimation(827);
               deleteItem(960, getItemSlot(960), 1);
               makeGlobalObject(absX, absY, 2213, 0, 10);
               addSkillXP(180, 11);
               sM("You build a Bank booth");
               resetWC();
            } else {
               sM("You need a construction Level of 0 to build this");
            }

Can somebody Help me so you can only do the "itemonitem" if your in a certian place :/

Offline Chandlermaki

  • Rune Member
  • *
  • Posts: 129
  • Rep 6
  • You's trollin'.
  • Location: USA
    • View Profile
Re: ItemonItem construction.
« Reply #1 on: March 30, 2011, 03:00:41 pm »
Code: [Select]
Disregard
I may have made a mistake here, but it should work.
« Last Edit: March 30, 2011, 04:19:55 pm by Chandlermaki »
Insert clever signature here.

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #2 on: March 30, 2011, 03:06:51 pm »
But would that make it so i can only do the Construction itemonitem in a Certain place

Offline Chandlermaki

  • Rune Member
  • *
  • Posts: 129
  • Rep 6
  • You's trollin'.
  • Location: USA
    • View Profile
Re: ItemonItem construction.
« Reply #3 on: March 30, 2011, 03:39:45 pm »
Declare that boolean.

Then turn this
Code: [Select]
         if ((itemUsed == 2347) && (useWith == 960)) {
            if (playerLevel[11] >= 0) {
               setAnimation(827);
               deleteItem(960, getItemSlot(960), 1);
               makeGlobalObject(absX, absY, 2213, 0, 10);
               addSkillXP(180, 11);
               sM("You build a Bank booth");
               resetWC();
            } else {
               sM("You need a construction Level of 0 to build this");
            }

Into this:
Code: [Select]
  if (inConstruction()) {       
      if ((itemUsed == 2347) && (useWith == 960)) {
            if (playerLevel[11] >= 0) {
               setAnimation(827);
               deleteItem(960, getItemSlot(960), 1);
               makeGlobalObject(absX, absY, 2213, 0, 10);
               addSkillXP(180, 11);
               sM("You build a Bank booth");
               resetWC();
            } else {
               sM("You need a construction Level of 0 to build this");
            }
            } else {
               sM("You must be in a construction zone to do that!");
        }

Again, may have made a mistake. Should work though. Also, I apologize for not using conventions. I'm typing this inside the reply box, so I have no use of the tab key.
Insert clever signature here.

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #4 on: March 30, 2011, 04:00:42 pm »
Would this work?
Quote
   public boolean inConstruction() {
      if(absX >= LOWEST X VALUE HERE && absX <= HIGHEST X VALUE HERE = absY >= LOWEST Y VALUE HERE = absY <= HIGHEST Y VALUE HERE) {
      return true;
      }
      return false;
      }
      

Had to edite it to not give me errors

Offline Chandlermaki

  • Rune Member
  • *
  • Posts: 129
  • Rep 6
  • You's trollin'.
  • Location: USA
    • View Profile
Re: ItemonItem construction.
« Reply #5 on: March 30, 2011, 04:18:39 pm »
Quote
public boolean inConstruction() {
if(absX >= xxxx && absX <= xxxx && absY >= xxxx && absY <= xxxx)
return true;
else
return false;
}

That should work. I don't know why it's not.

EDIT: Had an extra bracket, silly me. I pulled an all nighter and I'm feeling a bit loopy.
« Last Edit: March 30, 2011, 04:44:01 pm by Chandlermaki »
Insert clever signature here.

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #6 on: March 30, 2011, 04:49:24 pm »
Okay i will try

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #7 on: March 30, 2011, 05:02:19 pm »
Okay that works great thankyou :)   
Can you make it so when the player has made the object he walks away? because he stands on the object atm

Offline Chandlermaki

  • Rune Member
  • *
  • Posts: 129
  • Rep 6
  • You's trollin'.
  • Location: USA
    • View Profile
Re: ItemonItem construction.
« Reply #8 on: March 30, 2011, 05:11:13 pm »
I'll help you out with that over MSN if you'd like, but it'll have to wait until I get home.

Would you prefer that the character didn't move, and the object was created in the coordinate right in front of them instead?

By the way, I'd love to help you test your server when you're ready.
« Last Edit: March 30, 2011, 05:13:33 pm by Chandlermaki »
Insert clever signature here.

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #9 on: March 30, 2011, 05:34:05 pm »
Yea spawning objects infront would be Better :)

Offline Chandlermaki

  • Rune Member
  • *
  • Posts: 129
  • Rep 6
  • You's trollin'.
  • Location: USA
    • View Profile
Re: ItemonItem construction.
« Reply #10 on: March 30, 2011, 05:50:28 pm »
Alright. I'll pull out my old DeltaCleaned and get to work on some construction for you.
Insert clever signature here.

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: ItemonItem construction.
« Reply #11 on: March 30, 2011, 06:12:43 pm »
mate when you'r on msn I think we should talk :P
I got a feeling us 2 together could Pull something amazing together XD