Site closing soon. not enough active people all posts and topics will be deleted and it will be comfimed deleted
moparscapehelper
April 15, 2024, 11:29:00 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
 
  Home Help Search Arcade Links Staff List Members Login Register  

FIXING MED HELMS AND HOODS !!!yAY ME

Pages: [1]
  Print  
Author Topic: FIXING MED HELMS AND HOODS !!!yAY ME  (Read 821 times)
0 Members and 1 Guest are viewing this topic.
steve4448
Guest
« on: July 24, 2007, 11:54:39 pm »

Purpose:To fix the really annoying no chin when wearing hoods/med helms.

Difficulty:3/10

Classes Modified:Item.java and client.java

Procedure:
First off lets take a look at client.java.  Take a look at public in item type.
In it, you should see:


      
Code:
for (int i = 0; i < Item.hats.length; i++) {
if(item == Item.hats[i]) {
return playerHat;
}
}
Notice how you have many of these, what this does, is call the int from item.java, hats, and processes to almost complete the chin glitch, but there's still more.  Notice how there is nothing that says item.meds.length etc.  So, edit this, so that it will call the boolean from item.java.
COPY AND EDIT THIS:


      
Code:
for (int i = 0; i < Item.hats.length; i++) {
if(item == Item.hats[i]) {
return playerHat;
}
}
Now, close client.java and open player.java and take a look at the protected void appendPlayerAppearance.  In this void, you will see things very similar to this:


           
Code:
if(playerEquipment[playerHat] > 1)
            {
                playerProps.writeWord(512 + playerEquipment[playerHat]);
            } else
            {
                playerProps.writeByte(0);
            }
What this is, it MAKES your hat appear, it creates the model and fixes your face, if this was not added, if you wore a helmet, mask, hat, etc; your face would NOT appear.  So, lets take a look at this:

Code:
if(!Item.isFullHelm(playerEquipment[playerHat])
Make it say:
           
Code:
if(!Item.isFullHelm(playerEquipment[playerHat]) && !Item.isFullMask(playerEquipment[playerHat]) && !Item.is*BOOLEAN IN ITEM.JAVA*(playerEquipment[playerHat]))
Now that that is added, we are ALMOST done with this annoying glitch.

Close player.java and open Item.java.
Take a look at all those ints you see right when you open Item.java, you see, these are all the ints.  Search for:

Code:
public static boolean isFullHelm(int item ID)
{
for (int i=0; i<fullHelm.length; i++)
if (fullHelm[i] == itemID)
return true;
return false;
}.
I mentioned this boolean earlier that were being called upon, when I discussed client.java.  So, to completely finish this glitch, you would make another boolean that you declared earlier in client.java, I myself use boolean isMedHelm, because it is easy to remember. 
Edit this to fit your int that was stated earlier in client.java


Code:
public static boolean isFullHelm(int itemID)
{
for (int i=0; i<fullHelm.length; i++)
if (fullHelm[i] == itemID)
return true;
return false;
}
In the end, mine looks like this:

Code:
public static boolean isMedHelm(int itemID)
{
for (int i=0; i<med.length; i++)
if (med[i] == itemID)
return true;
return false;
}
Now, finish your boolean, add your item ids to your previous int, and you should be done.  BUT!  Listen, now that you have a whole new int, you MUST delete all item ids that are med helms/hoods that were written in other ints.  If you do not, you just wasted your time reading and adding this tutorial.  REMEMBER, DO NOT BE INCONSISTENT WITH YOUR INTS/BOOLEANS!

Credits:Me, for taking my time in looking into this glitch and fixing it.
AD LVL 7 for reminding me about the needed static boolean in item.java.
Mr. Brightside for writing a void that I was too lazy to write.
Report Spam   Logged

Share on Facebook Share on Twitter

frobiez
Guest
« Reply #1 on: October 10, 2007, 05:08:34 pm »

nice job Cheesy
Report Spam   Logged
steve4448
Guest
« Reply #2 on: October 10, 2007, 05:09:45 pm »

thx mate Smiley
Report Spam   Logged
mager858
Guest
« Reply #3 on: November 09, 2007, 04:06:27 pm »

yeh this is good for silab starterz Tongue
Report Spam   Logged
steve4448
Guest
« Reply #4 on: November 27, 2007, 10:29:55 am »

Yes very good
Report Spam   Logged
Pages: [1]
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy