Looks like it might be this:
playerCommand.substring(7)
try changing the 7 to something lower.
|
Fixed the capitalisation, now my only problem is every 2 chars of the yell get blanked/deleted?
Code:if(playerCommand.startsWith("yell")) { if(!Connection.isMuted(c)) { for(int j = 0; j < Server.playerHandler.players.length; j++) { if(Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; if(c.playerRights == 2) { c2.sendMessage("@bla@[@cya@ASSISTANT@bla@]@blu@"+Misc.optimizeText(c.playerName)+":"+playerCommand.substring(7));
Looks like it might be this:
playerCommand.substring(7)
try changing the 7 to something lower.
Fixed it thanks bro
Shouldn't usernames be capitalized / formatted upon login?
Try something like this:
Code:String[] cmd = playerCommand.split(" "); cmd[0] = cmd[0].toLowerCase(); String message = playerCommand.substring(cmd[0].length + 1); if(cmd[0].equals("yell") && c.playerRights == 2) { if(!Connection.isMuted(c)) { for(Player player : Server.playerHandler.players) { if(player != null) { ((Client)player).sendMessage("@bla@[@cya@ASSISTANT@bla@]@blu@" + Misc.optimizeText(c.playerName) + ":" + message); } } } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |