clayd Moderator
Posts : 8 Reputation : 0 Join date : 2009-11-15
| Subject: 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! | |
|
Owner Admin
Posts : 41 Reputation : 2 Join date : 2009-11-15 Age : 30 Location : Everywhere.
| Subject: 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. | |
|
clayd Moderator
Posts : 8 Reputation : 0 Join date : 2009-11-15
| Subject: 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 | |
|
Sponsored content
| Subject: Re: Adding Health and Prayer at top of client screen. | |
| |
|