Code:
src\server\model\players\packets\Commands.java:61: cannot find symbol
symbol : variable customYellTag
location: class server.model.players.Client
c.customYellTag = playerCommand.substring(8);
^
src\server\model\players\packets\Commands.java:62: cannot find symbol
symbol : variable customYellTag
location: class server.model.players.Client
c.sendMessage("Your custom yell tag is now: " + c.customYellTag);
^
src\server\model\players\packets\Commands.java:86: cannot find symbol
symbol : variable customYellTag
location: class server.model.players.Client
ranks[1] = "[" + c.customYellTag + "]";
^
src\server\model\players\packets\Commands.java:89: cannot find symbol
symbol : variable yellDelay
location: class server.model.players.Client
c.yellDelay = 0;
^
src\server\model\players\packets\Commands.java:90: incompatible types
found : java.lang.String
required: long
c.lastYell = playerCommand.substring(5);
^
Note: src\server\world\map\C.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
Trykk en tast for å fortsette...
THIS IS WHAT IM TRYING TO ADD
Code:
if (playerCommand.toLowerCase().startsWith("yelltag") && playerCommand.length() > 8) {
try {
String tempTag = playerCommand.substring(8);
String[] blocked = { "coder", "owner", "gian", "mike", "www", "com", "tk", "no-ip", "scape", "join", "c0der", "0wner" };
if (c.playerRights < 1) {
c.sendMessage("Only special donators may use this feature.");
return;
}
if (!c.playerName.equalsIgnoreCase("(Name Here|Name Here|Name Here)")) {
if (tempTag.length() < 3 || tempTag.length() > 12)
c.sendMessage("Custom yell tags must be 3-12 characters long!");
for (int i = 0; i < blocked.length; i++)
if (tempTag.toLowerCase().contains(blocked[i])) {
c.sendMessage("The yell tag you have tried using contains words which arent allowed...");
c.sendMessage("If you abuse the custom yell tag system your donator rights will be taken away.");
}
return;
}
c.customYellTag = playerCommand.substring(8);
c.sendMessage("Your custom yell tag is now: " + c.customYellTag);
c.sendMessage("If you abuse the custom yell tag system your donator rights will be taken away.");
} catch(Exception e) {
e.printStackTrace();
}
}
if (playerCommand.toLowerCase().startsWith("yell")) {
try {
String[] colors = { "@dbl@", "@dbl@", "@dre@", "@red@", "@red@", "@red@" };
String[] ranks = { "[Donator]", "[Donator]", "[Mod]", "[Admin]", "[yournamehere]", "[Owner]" };
int arraySlot = -1;
if (c.playerRights == 1)
arraySlot = 2;
if (c.playerRights == 2)
arraySlot = 3;
if (c.playerName.equalsIgnoreCase("Name Here"))
arraySlot = 4;
if (c.playerName.equalsIgnoreCase("Name Here"))
arraySlot = 5;
if (c.playerRights == 4) {
if (arraySlot != -1)
colors[1] = colors[arraySlot];
arraySlot = 1;
ranks[1] = "[" + c.customYellTag + "]";
}
if (arraySlot != -1) {
c.yellDelay = 0;
c.lastYell = playerCommand.substring(5);
for (int j = 0; j < Server.playerHandler.players.length; j++)
if (Server.playerHandler.players[j] != null) {
Client p = (Client)Server.playerHandler.players[j];
p.sendMessage(ranks[arraySlot] + " " + c.playerName + ": " + colors[arraySlot] + " " + Misc.optimizeText(playerCommand.substring(5)));
}
} else if (arraySlot == -1) {
c.sendMessage("This feature is only available to Donators and members of Staff.");
c.sendMessage("Donator rank can be purchased for $5 via 'Paypal.Com'.");
}
} catch(Exception e) {
e.printStackTrace();
}
}