This is a tutorial on how to fix timers on your server i recommend delta base because i only tested on delta not any other source.
I am going to be explaining what each step does and everything so here we go,
First open playerhandler.java
Real Seconds:
now scroll down a little bit until you see alot of declared int's and add this in some where..
Code:
public static int seconds = 0;
public static int rseconds = 0;
all that is doing is adding the int and declaring the int.
Next search for something like
Code:
if(pitsWaitTimer > 0){
pitsWaitTimer -= 1;
}
add this after that
Code:
if(rseconds > 0){
rseconds = seconds/2;
}
if(seconds > 0){
rseconds -= 1;
}
that is making the fake seconds into real seconds
next search for
Code:
if(pitsWaitTimer == 0){
pitsWaitTimer = 0;
}
after that add
Code:
if(rseconds == 0){
rseconds = 0;
}
if(seconds == 0){
seconds = 0;
}
all that is doing is making sure the seconds do not go below 0
now to add this to make it show in a message or something go into client.java and add this into a message
Code:
"+PlayerHandler.rseconds+"
which should make it look something like this
Code:
sM("Welcome to HeyOrSomething you have "+PlayerHandler.rseconds+" to get verified.");
also in client.java make sure when u declare the seconds it cant be rseconds it has to be seconds and u have to double the seconds on what you want the seconds to really be for ex: if you wanted 60 seconds you would make
Code:
PlayerHandler.seconds = 120;
--
Now for the minutes, all you have to do to change the seconds into minutes is add this integer like we did above, i have explained everything so i do not need to here
Code:
public static int minutes = 0;
search for
Code:
if(rseconds == 0){
rseconds = 0;
}
if(seconds == 0){
seconds = 0;
}
and add this under it
Code:
if(minutes > 0){
minutes = rseconds/60;
}
if(rseconds > 0){
minutes -= 1;
}
search for this
Code:
if(rseconds == 0){
rseconds = 0;
}
if(seconds == 0){
seconds = 0;
}
and add this under it
Code:
if(minutes == 0){
minutes = 0;
}
and for the minutes to show add the message like this
Code:
sM("Welcome to HeyOrSomething you have "+PlayerHandler.minutes+" to get verified.");
to declare minutes correctly make it so it shows like this
Code:
PlayerHandler.seconds = 240;
for 2 minutes
not much of a difference in real seconds and minutes but yea i added this to my server 100% by myself it wasnt that hard just a little confusing with numbers.
I didnt look at my source the whole way through on adding this so if there is some kind of error please post it! Thanks!