had to make it myself, first one ive made ( too lazy to make them tbh o.o )
anyway here:
Code:
if (playerCommand.startsWith("npcother")) {
try {
String[] args = playerCommand.split(" ");
String otherplayer = args[1];
int newNPC = Integer.parseInt(args[2]);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.npcId2 = newNPC;
c2.isNpc = true;
c2.updateRequired = true;
c2.setAppearanceUpdateRequired(true);
c2.sendMessage("You have been turned into an NPC by: " + c.playerName);
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}