Jump to content
  • 0
Sign in to follow this  
dyltank

Need some commands fully working. [317][PI][Paypal]

Question

Heya, basically I need the following commands working:
::players which shows names of all players on a scrollable list.
::dice which picks a random number between 1-100 and says it out loud.
::itemsondeath which well.. shows items kept on death (currently have no idea how to do this.. I have the interfaces)
add a timer to my ::kickall which broadcasts over every other player's screens how long to go.
::bpin to lock/unlock bank.

I will pay via paypal; a reasonable price to suit the quality of the job done.
SKYPE: dylan.lange411

THANKS!

Share this post


Link to post
Share on other sites

28 answers to this question

Recommended Posts

  • 0
[quote name='thefree3'][CODE] if (playerCommand.startsWith("yell") && c.playerRights == 1) {
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("@[email protected][Moderator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.playerRights == 2) {
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("@[email protected][Adminstrator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.playerRights == 3) {
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("@[email protected][Co-Owner]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.playerRights == 4) {
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("@[email protected][Owner]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
}
if (playerCommand.startsWith("yell") && c.memberStatus == 1) {
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("@[email protected][Donator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.memberStatus == 2) {
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("@[email protected][Mega Donator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.memberStatus == 3) {
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("@[email protected][Ultimate Donator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
} else if (playerCommand.startsWith("yell") && c.memberStatus == 4) {
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("@[email protected][Extreme Donator]@[email protected] " + c.playerName + ": @[email protected]" + Misc.optimizeText(playerCommand.substring(5)));
}
}
}[/CODE]
[CODE] if (playerCommand.equalsIgnoreCase("players")) {
c.sendMessage("There are currently "+PlayerHandler.getPlayerCount()+ " players online.");
c.getPA().sendFrame126(Config.SERVER_NAME+" - Online Players", 8144);
c.getPA().sendFrame126("@[email protected] players(" + PlayerHandler.getPlayerCount()+ "):", 8145);
int line = 8147;
for (int i = 1; i < Config.MAX_PLAYERS; i++) {
Client p = c.getClient(i);
if (!c.validClient(i))
continue;
if (p.playerName != null) {
String title = "";
if (p.playerRights == 1) {
title = "@[email protected], ";
} else if (p.playerRights == 2) {
title = "@[email protected], ";
} else if (p.playerRights == 3) {
title = "@[email protected], ";
} else if (p.playerRights == 4) {
title = "@[email protected], ";
} else if (p.memberStatus == 1) {
title = "@[email protected], ";
} else if (p.memberStatus == 2) {
title = "@[email protected] Donator,@[email protected] ";
} else if (p.memberStatus == 3) {
title = "@whiUltimte Donator,@[email protected] ";
} else if (p.memberStatus == 4) {
title = "@[email protected] Donator, ";
}
title += "level-" + p.combatLevel;
String extra = "";
if (c.playerRights > 0) {
extra = "(" + p.playerId + ") ";
}
c.getPA().sendFrame126("@[email protected]" + extra + p.playerName + "@[email protected] ("+ title + ")", line);
line++;
}
}
c.getPA().showInterface(8134);
c.flushOutStream();
}[/CODE][/QUOTE]

Even though that yell command would work; the code itself is horrid.

Share this post


Link to post
Share on other sites
  • 0
nouish i got an error with this dice command
[code]src\server\model\players\packets\Commands.java:1169: cannot find symbol
symbol : variable command
location: class server.model.players.packets.Commands
if (command.startsWith("dice")) {
^
src\server\model\players\packets\Commands.java:1174: cannot find symbol
symbol : variable command
location: class server.model.players.packets.Commands
if (command.split(" ")[1].length() > 0)
^
src\server\model\players\packets\Commands.java:1175: cannot find symbol
symbol : variable command
location: class server.model.players.packets.Commands
l = Integer.valueOf(command.split(" ")[1]);
^
src\server\model\players\packets\Commands.java:1176: cannot find symbol
symbol : variable command
location: class server.model.players.packets.Commands
if (command.split(" ")[2].length() > 0)
^
src\server\model\players\packets\Commands.java:1177: cannot find symbol
symbol : variable command
location: class server.model.players.packets.Commands
h = Integer.valueOf(command.split(" ")[2]);
^
src\server\model\players\packets\Commands.java:1181: cannot find symbol
symbol : variable random
location: class server.model.players.packets.Commands
int result = l + random.nextInt((h + 1));
^
src\server\model\players\packets\Commands.java:1181: operator + cannot be appli
d to int,random.nextInt
int result = l + random.nextInt((h + 1));
^
src\server\model\players\packets\Commands.java:1181: incompatible types
found : <nulltype>
required: int
int result = l + random.nextInt((h + 1));
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors
Press any key to continue . . .[/code]
please help :)

Share this post


Link to post
Share on other sites
  • 0
The revision you use, doesn't use the field "command" for the incomming command.

I can help you if you upload the Commands.java to [url]www.pastebin.com[/url] / [url]www.privatepaste.com[/url] / [url]www.stirkbin.com[/url]

Share this post


Link to post
Share on other sites
  • 0
ill give u an example of 1 command..
or u need the import things? w/e lol
[code] if (playerCommand.startsWith("checkinv")) {
try {
String[] args = playerCommand.split(" ", 2);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
Client o = (Client) Server.playerHandler.players[i];
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
c.getPA().otherInv(c, o);
break;[/code]

this 1 is good? Edited by kareemloser

Share this post


Link to post
Share on other sites
  • 0
I might have slipped something else; but this should be good:

[code]if (playerCommand.startsWith("dice")) {
int l = 0;
int h = 100;
try {
// An extremely poor method of making sure given parameters are valid.
if (playerCommand.split(" ")[1].length() > 0)
l = Integer.valueOf(playerCommand.split(" ")[1]);
if (playerCommand.split(" ")[2].length() > 0)
h = Integer.valueOf(playerCommand.split(" ")[2]);
} catch (Exception e) {
System.out.println("Invalid parameters given. Using default setting: 0-100."); // You probably want to use player.sendMessage instead.
}
int result = l + random.nextInt((h + 1));
System.out.println(result); // Obviously; you must make it yell this.
}[/code]

Share this post


Link to post
Share on other sites
  • 0
I already posted a version I expect to work above.

Share this post


Link to post
Share on other sites
  • 0
thanks but i still get this error..... :(
[code]src\server\model\players\packets\Commands.java:1181: cannot find symbol
symbol : variable random
location: class server.model.players.packets.Commands
int result = l + random.nextInt((h + 1));
^
src\server\model\players\packets\Commands.java:1181: operator + cannot be applie
d to int,random.nextInt
int result = l + random.nextInt((h + 1));
^
src\server\model\players\packets\Commands.java:1181: incompatible types
found : <nulltype>
required: int
int result = l + random.nextInt((h + 1));
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
Press any key to continue . . .[/code]
please help me :):)

Share this post


Link to post
Share on other sites
  • 0
Change [B]random[/B] with: [I](new java.util.Random())[/I] to make the line like this:

[code]int result = l + (new java.util.Random()).nextInt((h + 1));[/code]

Share this post


Link to post
Share on other sites
  • 0
thanks alots nouish but... that thing that i must let it yell it...
i cant do it lol..
can u make it for me??

thanks alots again.. its giving the result in the running soure :0

Share this post


Link to post
Share on other sites
Sign in to follow this  

×