It's not checking if the players are null.
|
|

Method:
command:Code:public void clanYell(String message) { for (Player p : handler.players) { if ((message.indexOf("tradereq") > 0) || (message.indexOf("duelreq") > 0)) { return; } if ((p == null) || !p.isActive) { continue; } client temp = (client) p; if ((temp.absX > 0) && (temp.absY > 0 && temp.ccChannel == ccChannel)) { if ((temp != null) && !temp.disconnected && p.isActive) { temp.sM(message); } } } }
Okay so here's how it works, it displays the "clan chat message" to those with the same clan chat id, but it only displays for me and not globally to others with the same id?Code:if (command.startsWith("y3ll")) { String text = command.substring(5); clanYell(" "+playerName+": "+text+" "); }
It's not checking if the players are null.

Not before player variables were accessed which would immediately crash.
Code:public void clanYell(String message) { if (message.endsWith(":tradereq:") || message.endsWith(":duelreq:")) { return; } for (int i = 0; i < handler.players.length; i++) { client player = (client)handler.players[i]; if (player != null && player.isActive && !player.disconnected && player.ccChannel == ccChannel) { player.sM(message); } } }

| « changing ports delta | Custom tags » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |