did you try restart you computer?
|
Ok so i decided to add a c2.sendMessage so my players know what update it is, either a update to add/fix content or just a general update ect..
this is my codeit all works fine, it sends the message ect.. however the update does not wait until the count down is finished and kicks everyone off before the count down hits 0.if (playerCommand.startsWith("update")) {
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
String[] args = playerCommand.split(" ");
int a = Integer.parseInt(args[1]);
PlayerHandler.updateSeconds = a;
PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true;
c2.sendMessage ("Check the forums for the latest updates!");
}
}
}
for example if i set my timer to say 20 seconds (::update 20) it would get to 17 seconds and kick everyone off.. i know its probably todo with the way i have put the code but i can't figure out which way it should go.
try adding in this
so it would look like thisCode:PlayerHandler.updateStartTime = System.currentTimeMillis();
**** ma bad double post, delete dis one plsCode:PlayerHandler.updateRunning = true; c2.sendMessage ("Check the forums for the latest updates!");
try adding in this
so it would look like thisCode:PlayerHandler.updateStartTime = System.currentTimeMillis();
Code:if (playerCommand.startsWith("update")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; String[] args = playerCommand.split(" "); int a = Integer.parseInt(args[1]); PlayerHandler.updateSeconds = a; PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); c2.sendMessage ("Check the forums for the latest updates!"); } } }
Thanks man and to you vovik.. no i didnt
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |