HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 How to add a clock to your server

View previous topic View next topic Go down 
AuthorMessage
Richard
Street Tramp


Posts : 157
Awesomeness : 0
Join date : 2009-09-07
Age : 26

PostSubject: 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
Back to top Go down
View user profile http://Quarion.org
 
How to add a clock to your server
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» .^f2F-.Swemmei Recruting in server 1
» Lag playing in Taiwan server from Shanghai
» Proxy Server Taiwan: How To.
» WoW "Development" Server
» Omnos (( Maybe another name depending on server)) Sunbearer

Permissions in this forum:You cannot reply to topics in this forum
BBS-OnlinePK :: Off Topic :: Development of RSPS :: 317 Source Work :: Guides-
Jump to: