Once again, change the [Project 72] to [Delta], this doesn't only work on your base.
|
|
Okay, this is a little more advanced, just pay attention.
- Step one
Make a new txt file & save it as commands.java & save as all file types.
Then add this inside of it
Code:public class commands { public void command(int a){ client p = (client) server.playerHandler.players[a]; //Add new code below here }//DO NOT ADD CODE PAST HERE. }- Step two
go into server.java & find
Under that addCode:public static cases cases = null;
Code:public static commands commands = null;- Step three
Find
& Under that addCode:cases = new cases();
Code:commands = new commands();- Step four
Open Client.java & find this
Copy everything in that into your new file betwwen the correct brackets. (between add below here & before here.)Code:private void customCommand(String command) {
YourShould like thisCode:private void customCommand(String command) {
Now replace that withCode:private void customCommand(String command) { }
Code:private void customCommand(String command) { server.commands.command(playerId); }- Last Step
add p. infront of mostly everything like "sM" would be "p.sM"
Post questions, & I'll be glad to answer them
Example:
Would beCode:if(command.equalsIgnoreCase("runes")) { for(int i = 553; i < 567; i++) { addItem(i, 2147000000); } }
You only have to add p. infront of a method if it's located in client.java if it's delcared in the commands file you have no need to put a p. infrontCode:if(command.equalsIgnoreCase("runes")) { for(int i = 553; i < 567; i++) { p.addItem(i, 2147000000); } }

Once again, change the [Project 72] to [Delta], this doesn't only work on your base.


We have a winner.Code:private void customCommand(String command) { server.commands.command(playerId); }

lols Blair.. Nice i guess except the fact it takes 5 mins![]()


How long is it?
Alos I hoped you would see your mistake.
customCommands is only called in a single spot. Instead of adding your command class be call in a method that is run when a packet is recieved just make it
Code:case 103:// or what ever the command packet is server.commands.command(command, playerid);
| « Fixing Dragon CLaws from 60 Def to 60 Attack | [Project 72] Adding commands for 48 mutes & membershipdays. » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |