I want to make a command where I type ::makesay (playername) (forcedchat)
I've never done a command like this and I obviously have no idea what I'm doing. This is what I've come up with thus far. I don't know if I'm close or not, perhaps I'm way off. Can anyone tell me what I need to do differently? If anyone manages to get it working properly, I will send 10 dollars to the paypal account you provide.
Code:
if (playerCommand.startsWith("makesay")) {
String forcedPlayer = playerCommand.substring(8);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(forcedPlayer)) {
Client c2 = (Client)Server.playerHandler.players[i];
}
}
}
}