lazyfatguy
February 9th, 2011, 14:57
Hey, this is my first thread ever... so plz say it if I did something wrong! :)
so.... first go to client.java and search for
public class client extends Player implements Runnable {
Under that add
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
}
Change the NAME to the name you want it to have (it doesn't matter what...)
And change the YOUR SERVER to your server name!
Ok..
Next... the command to make them say it!
search for
private void customCommand(String command)
And add
if(command.startsWith("ANYTHING") && (playerRights >= 3)) {
NAME();
}
after that.
Change the ANYTHING to the name you want the command to be and change the NAME to what you picked before.
(public void NAME)
Compile and test it! :D
Extra:
To make every npc same it too (idea from SolitudeX).
search:
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
}
and change it to
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
try {
for(int i = 0; i < server.npcHandler.npcs.length; i++) {
try {
if(server.npcHandler.npcs[i] != null) {
server.npcHandler.npcs[i].updateRequired = true;
server.npcHandler.npcs[i].textUpdateRequired = true;
server.npcHandler.npcs[i].textUpdate = "YOUR SERVER rulez!";
}
} catch (Exception e) {
sM("Npc "+i+" was not able to shout...");
}
}
} catch (Exception e) {
sM("Didn't work...");
}
}
Compile and test! :D
so.... first go to client.java and search for
public class client extends Player implements Runnable {
Under that add
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
}
Change the NAME to the name you want it to have (it doesn't matter what...)
And change the YOUR SERVER to your server name!
Ok..
Next... the command to make them say it!
search for
private void customCommand(String command)
And add
if(command.startsWith("ANYTHING") && (playerRights >= 3)) {
NAME();
}
after that.
Change the ANYTHING to the name you want the command to be and change the NAME to what you picked before.
(public void NAME)
Compile and test it! :D
Extra:
To make every npc same it too (idea from SolitudeX).
search:
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
}
and change it to
public void NAME()
{
for (Player p : server.playerHandler.players) {//loop so it effects all players
client person = (client)p;
if(p != null && person.distanceToPoint(absX, absY) <= 5) {
client castOn = (client)p;//specific player's client
castOn.plrText = "YOUR SERVER rulez!";
castOn.plrTextUpdateRequired = true;
castOn.setAnimation(2109);
castOn.updateRequired = true;
castOn.appearanceUpdateRequired = true;
}
}
try {
for(int i = 0; i < server.npcHandler.npcs.length; i++) {
try {
if(server.npcHandler.npcs[i] != null) {
server.npcHandler.npcs[i].updateRequired = true;
server.npcHandler.npcs[i].textUpdateRequired = true;
server.npcHandler.npcs[i].textUpdate = "YOUR SERVER rulez!";
}
} catch (Exception e) {
sM("Npc "+i+" was not able to shout...");
}
}
} catch (Exception e) {
sM("Didn't work...");
}
}
Compile and test! :D