/time countdown
Is there any way for someone to create a plugin where if someone says /countdown to show how exactly (years)/months/days/minutes/seconds until a chosen day are?
|
Re: /time countdown
Here is a quick version. Note that the days might be a bit off and the month in some rare cases could be one off due to having to assume each month is only 30 days. Doing it correctly I think it more complicated.
The countdown_target cvar needs to the the unix timestamp of the target date/time. You can convert a date/time to a unix timestamp on several websites online. PHP Code:
|
Re: /time countdown
It works! Thank you very much!
|
Re: /time countdown
I think that using parse_time we were able to overcome the problem of months with plus or minus days.
PHP Code:
HTML Code:
Time to day 09:00:00 11/22/2023: 388 day(s) e 19 Hour(s) |
Re: /time countdown
i just noticed that fysiks plugin shows now that countdown expired even if it doesn't and it showed at first exactly the time i specified, i tried to change the cvar to another date, but it still shows me that the coundown expired
i will try icedr's one and come with a feedback! :) |
Re: /time countdown
Quote:
Quote:
|
Re: /time countdown
Took it off my VIP Expire plugin, just removed some parts:
PHP Code:
amx_display_time month/day/year If you want to know by hour/minute/second, just pass them as hour:minute:second Example: amx_display_time "10/30/2023" Code:
Time remaining: 1 year and 1 dayCode:
Time remaining: 4 years, 8 months, 1 day and 12 hoursCode:
Time remaining: 4 years, 8 months, 1 day, 13 hours, 24 minutes and 52 seconds |
Re: /time countdown
@EFFx,
|
Re: /time countdown
Quote:
|
Re: /time countdown
I've been using this system in a 24/7 32/32 players server and no errors displayed with even more calculations and display formats until now.
Quote:
|
| All times are GMT -4. The time now is 10:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.