TrickyTommy Posted November 8, 2017 Share Posted November 8, 2017 Hi. I made a table for player bans, right now it has 2 rows, one of it is the player's serial, and the other one is the reason. But the problem is, i can only make a system for permanent bans. I was wondering, how should i make a temporary one, and this is what i have come up so far: The player who banns should write the date until the ban is up like this: YYYYMMDDHHMM (all in together, it would look like this: 199903160010 So if the admin would like to ban him for a day, (199903170010) and if it passes by, the system checks the current date with the exact same format, and if the current date is bigger or equal to the date of expiry, it would let him pass the account system. Else it would say that the account is banned. This is my idea, but it might be complicated for admins to obey the format. Do you have a better one? If so, please let me know. Link to comment
TrickyTommy Posted November 8, 2017 Author Share Posted November 8, 2017 +: My problem is that getRealTime()'s month function returns the month without 0. And the number is less without the 0 and may work incorrectly. Link to comment
WorthlessCynomys Posted November 8, 2017 Share Posted November 8, 2017 Use timestamp. Seconds since 1970 january 1 00:00. Count the time for the ban in seconds, give it to the current timestamp, upload it to sql as an int and compare that on join/login 1 Link to comment
TrickyTommy Posted November 8, 2017 Author Share Posted November 8, 2017 nice idea. i will give it a try, thanks. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now