Author Topic: [PI] Good ::yell command  (Read 1462 times)

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
[PI] Good ::yell command
« on: March 08, 2011, 01:07:30 pm »
Go to Commands.java and replace this with your old yell command.
Code: [Select]
if (playerCommand.startsWith("yell")) {
String rank = "";
String Message = playerCommand.substring(4);
if (c.playerRights >= 0 && c.isDonator >= 0) {
rank = "[@mag@Player@bla@]["+ c.playerName +"]:";
}
if (c.playerRights >= 0 && c.isDonator >= 1) {
rank = "[@gre@Donator@bla@]["+ c.playerName +"]:";
}
if (c.playerRights >= 1) {
rank = "[@blu@Mod@bla@]["+ c.playerName +"]:";
}
if (c.playerRights >= 2) {
rank = "[@yel@Admin@bla@]["+ c.playerName +"]:";
}
if (c.playerRights >= 3) {
rank = "[@red@Owner@bla@]["+ Misc.ucFirst(c.playerName) +"]:";
}
if (c.playerName.equalsIgnoreCase("brandon")) {
rank = "[@red@Developer@bla@]["+ c.playerName +"]:";
}             
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.sendMessage(rank+Message);
}
}
}

Save, close, compile, done. Any questions ask.

Share on Bluesky Share on Facebook


Offline Jake

  • Bandos Member
  • *
  • Posts: 419
  • Rep 4
    • View Profile
Re: [PI] Good ::yell command
« Reply #1 on: March 09, 2011, 12:19:11 am »
Is it possible to make something like this on a dodian soucre?
Also is it possible to add something like this after killing a boss and it says the text over yell on a dodian soucre?

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #2 on: March 09, 2011, 11:55:22 am »
I checked out the Dodian server, it will not work on it, PI has its own custom code, same as Dodian, sorry.
« Last Edit: March 09, 2011, 12:11:22 pm by brandon »

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #3 on: March 10, 2011, 11:26:54 pm »
I dont like the way this is done :x but nice

here i made this cleaner for you :)
Code: [Select]
if (playerCommand.startsWith("yell")) {
String rank = "[@mag@Player@bla@]";
String Message = playerCommand.substring(4);
switch(c.playerRights) {
case 0:
rank = (c.isDonator >= 0 ? "[@gre@Donator@bla@]" : "[@mag@Player@bla@]");
break;
case 1:
rank = "[@blu@Mod@bla@]";
break;
case 2:
rank = "[@yel@Admin@bla@]";
break;
case 3:
rank = "[@red@Owner@bla@]";
break;
}
if(c.playerName.equals("brandon"))
rank = "[@red@Developer@bla@]["+ c.playerName +"]:";

for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
c2.sendMessage(rank + "[" + c.playerName + "]: " + Message);
}
}
}

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #4 on: March 10, 2011, 11:33:33 pm »
Alright Mr. Pro Coder. :P Good of you to be here, not many PI people here. Also by chance do you have the;

Quote
public void addSpecialBar(int weapon) {

For Statius's Warhammer? Cant find the codes for it. Thanks.


Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #5 on: March 10, 2011, 11:39:32 pm »
I'll look it up and post it back here ;]

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #6 on: March 10, 2011, 11:45:33 pm »
I'll look it up and post it back here ;]

Thanks a lot, I am pretty sure that is the issue because neither my Granite maul or Statius's Warhammer or using there special attack. The bar is there but when I click on it nothing happens I am positive the issue is in the special bar. Thanks again. Rep++ if you can find. :)

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #7 on: March 10, 2011, 11:51:27 pm »
U say the special bar is there? Thenhave you tried adding the special attack itself to the combatAssistant?

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #8 on: March 11, 2011, 12:21:48 am »
U say the special bar is there? Thenhave you tried adding the special attack itself to the combatAssistant?

Yep. Here it is.
Code: [Select]
case 13902: //statius hammer
c.startAnimation(2062);
c.gfx100(1223);
c.specAccuracy = 1.1;
c.specDamage = 1.25;
c.hitDelay = getHitDelay(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase());
c.specEffect = 5;
break;

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #9 on: March 11, 2011, 12:32:24 am »
and that does nothing?

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #10 on: March 11, 2011, 12:51:04 am »
and that does nothing?

Yeah when I click on the spec bar the spec does not light up in yellow like its suppose to it just sites there.

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #11 on: March 11, 2011, 07:18:06 am »
It does the same for me i think. ill look for a fix.

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #12 on: March 11, 2011, 12:01:32 pm »
It does the same for me i think. ill look for a fix.

Yeah I tried you'r Statius's Warhammer on your server, same issue. Thanks.

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Good ::yell command
« Reply #13 on: March 11, 2011, 06:00:45 pm »
yeahh idk T_T

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [PI] Good ::yell command
« Reply #14 on: March 11, 2011, 06:06:57 pm »
I figured it out, my Statius's Warhammer works now :)