MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!


MegaMediaLife
 
HomeHomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Adding Health and Prayer at top of client screen.

Go down 
AuthorMessage
clayd
Moderator


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

PostSubject: Adding Health and Prayer at top of client screen.   Fri 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
View user profile
Owner
Admin
avatar

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

PostSubject: Re: Adding Health and Prayer at top of client screen.   Sat 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
View user profile http://Www.megamedialife.com
clayd
Moderator


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

PostSubject: Re: Adding Health and Prayer at top of client screen.   Sat 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
View user profile
Sponsored content




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

Back to top Go down
 
Adding Health and Prayer at top of client screen.
Back to top 
Page 1 of 1
 Similar topics
-
» Health 231 >> 197 by a panther, is it normal?
» Add your banner to the official Forum banners list
» The BETA Thread
» BabasChess 4.0 Build 12274 - FICS client
» How to apply Drop Shadow to your Images: Photoshop (any version)

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