MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!
MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!
MegaMediaLife
Would you like to react to this message? Create an account in a few clicks or log in to continue.


MegaMediaLife
 
HomeHomeLatest imagesSearchRegisterLog in

 

 Adding Health and Prayer at top of client screen.

Go down 
2 posters
AuthorMessage
clayd
Moderator



Posts : 8
Reputation : 0
Join date : 2009-11-15

Adding Health and Prayer at top of client screen. Empty
PostSubject: Adding Health and Prayer at top of client screen.   Adding Health and Prayer at top of client screen. EmptyFri Nov 20, 2009 11:45 pm

difficulty- .1 /10
purpose- Shows your current health and prayer at the top of client screen, and at certain level, It changes colors to yellow, and red.
class'es modified - client class.

First step open client.java, and under

Code:

public class client extends Player implements Runnable {

Add this
Code:

int quarterHealth;
int halfHealth;
public void ShowHealth() {
  halfHealth = playerLevel[playerHitpoints] / 2;
  quarterHealth = halfHealth / 2;
  if (currentHealth <= quarterHealth) {
    sendFrame126("@cya@Health =    @red@ "+currentHealth+"", 6572);
       sendFrame126("@cya@Prayer =  @gre@ "+playerLevel[5], 6664);
   
    setInterfaceWalkable(6673);
    }
  else if (currentHealth <=  halfHealth) { 
           sendFrame126("@cya@Health =    @yel@"+currentHealth+"", 6572);
       sendFrame126("@cya@Prayer = @gre@"+playerLevel[5], 6664);
    setInterfaceWalkable(6673);
    }
    else if (currentHealth >=  halfHealth) {
      sendFrame126("@cya@Health =    @gre@ "+currentHealth+"", 6572);
       sendFrame126("@cya@Prayer = @gre@"+playerLevel[5], 6664);
    setInterfaceWalkable(6673);
    }
}

Than go to
Code:

case 121
And below it add
Code:

ShowHealth();
then go to
Code:

Public boolean process() {
and under it add
Code:

ShowHealth();
Your done! and if you want to test, without using an npc, add this command.

Code:

if(command.startsWith("sethp") && playerRights >= 3){
int hp1 = Integer.parseInt(command.substring(6));
currentHealth = hp1;
sendMessage("Set health to " + hp1);
}

that allows you to type ::sethp ##
##= hp level.
100% credits to me!
Back to top Go down
Owner
Admin
Owner


Posts : 41
Reputation : 2
Join date : 2009-11-15
Age : 30
Location : Everywhere.

Adding Health and Prayer at top of client screen. Empty
PostSubject: Re: Adding Health and Prayer at top of client screen.   Adding Health and Prayer at top of client screen. EmptySat Nov 21, 2009 8:32 pm

Fuck, I might use this.
Also for delta, it would be sM, not send message. For delta users.
Back to top Go down
http://Www.megamedialife.com
clayd
Moderator



Posts : 8
Reputation : 0
Join date : 2009-11-15

Adding Health and Prayer at top of client screen. Empty
PostSubject: Re: Adding Health and Prayer at top of client screen.   Adding Health and Prayer at top of client screen. EmptySat Nov 21, 2009 8:53 pm

Well, If the person using it doesn't have enough sense to change it, then they shouldn't use it :p
Back to top Go down
Sponsored content





Adding Health and Prayer at top of client screen. Empty
PostSubject: Re: Adding Health and Prayer at top of client screen.   Adding Health and Prayer at top of client screen. Empty

Back to top Go down
 
Adding Health and Prayer at top of client screen.
Back to top 
Page 1 of 1
 Similar topics
-
» adding pest control with npc's and portals
» Adding XP Lock to your server (Stops your getting EXP when activated.)
» Does anyone know a good 317 source + client?
» 508 Client Without the White screens

Permissions in this forum:You cannot reply to topics in this forum
MegaMediaLife :: Runescape Private Servers :: 317 Related Boards :: Tutorials-
Jump to: