Richard Street Tramp
Posts : 157 Awesomeness : 0 Join date : 2009-09-07 Age : 33
| Subject: How to add a clock to your server Mon Sep 14, 2009 4:07 pm | |
| Difficulty 1/10 (c&p) Use: Add a clock to the top of your game window Files modified: client.java Replace your writePlayers() method with this: - Code:
-
public void writePlayers() { int players = PlayerHandler.getPlayerCount(); Calendar cal = new GregorianCalendar(); int hour24 = cal.get(Calendar.HOUR_OF_DAY); int min = cal.get(Calendar.MINUTE); int sec = cal.get(Calendar.SECOND); int timeHour = 0; int timeMin = 0; if(hour24 <= 12) { timeHour = hour24; timeMin = min; sendFrame126("@gre@ Online:@whi@ "+players, 174); if(min >= 0 && min <= 9) { sendFrame126("@gre@ "+timeHour+":0"+timeMin+" AM", 6570); } else { sendFrame126("@gre@ "+timeHour+":"+timeMin+" AM", 6570); } sendFrame126(" ", 6572); sendFrame126(" ", 6664); setInterfaceWalkable(6673); } else { timeHour = hour24-12; timeMin = min; sendFrame126("@gre@ Online:@whi@ "+players, 174); if(min >= 0 && min <= 9) { sendFrame126("@gre@ "+timeHour+":0"+timeMin+" PM", 6570); } else { sendFrame126("@gre@ "+timeHour+":"+timeMin+" PM", 6570); } sendFrame126(" ", 6572); sendFrame126(" ", 6664); setInterfaceWalkable(6673); } }
You can change the frame of the time and the players online or completely remove the online players part, if you know any Java at all only attempt this, otherwise don't try it unless you want to **** up your shit. Credits: Newton3788 | |
|