Source code can be provided on purchase if desired.
What is World Time?
World Time is a revolutionary new resource (Even better than the previous version) that aims to create a new way to sync time with players and get the game time on the server!
The fundamentals are the same as the Lua version with some major improvements! With World Time no matter what the system time reads you can use this resource to create clocks for all time zones!
What do I mean by create clocks?
World time enables you through the use of server exports (Provided below) to create clocks that can be used for all sorts of things, and most importantly you can select a clock to be the game clock which is synced with all players. The benefit of this is effectively you can create as many clocks as you need instead of being limited to 1.
What can I use clocks for?
Clocks can be used in many ways and have multiple use cases on any server! Clocks can vary in their speed which you define when you create them (Examples are provided) and can be used to create prisons sentences and check if the players sentence has ended. Clocks can also be used to get the current day cycle for a calendar day through the use of subdays, this is useful for being able to more easily reference when something occurred like a player getting injured rather than using the system time.
Why use World Time?
World time enables you to incorporate your own time zone into your server and it can be whatever you want! This reduces confusion on when something happened and when something will happen to create a more immersive experience!
Why two releases?
We have decided to release the two versions for two key reasons:
-
Many people do not feel comfortable working with C#, therefore the Lua version is still available unencrypted if modifications to the core functionality are desired by the customer.
-
The C# variant has been written from scratch and offers a different approach to the Lua version
Also all existing customers have already been upgraded for free
I purchased the Lua version before the C# release?
If you have purchased the Lua version and want the C# version, please contact me and you will get the C# version free of charge. However, all existing customers should already have access.
What are World Time’s exports?
// exports["ProjectSA_WorldTime"]:CreateClock(arg1, arg2, arg3)
inputs
--> arg1 --> int --> How many day cycles within one calander day [Must be divisible into 24]
--> arg2 --> int --> How many minutes past UTC+0 should the clock be offset by
--> arg3 --> string --> Defines the clocks reference name. Two Clocks cannot have the same name.
functionality
--> Creates a clock that exports can be used on later
returns
--> bool
--> true --> If clock was created
--> false --> If the clock was not created (Commonly due to duplicate reference name)
// exports["ProjectSA_WorldTime"]:DestroyClock(arg1)
inputs
--> arg1 --> string --> The refernce name which should be deleted (If multiple exist some how, all will be removed)
funcionality
--> Destroys a clock
returns
--> Nothing
// exports["ProjectSA_WorldTime"]:ClockGetModified(arg1, arg2)
inputs
--> arg1 --> string --> Clock reference name
--> arg2 --> double --> Minutes to advance (Game clock i.e 60 will result in 60 minutes passing in the game world)
functionality
--> Get the current clock with a time advancement (Does not modify the clock time)
returns
--> int[] --> Retuns a array/table with the clock time data (Format found at the bottom)
// exports["ProjectSA_WorldTime"]:ClockGetModifiedRT(arg1, arg2)
inputs
--> arg1 --> string --> Clock reference name
--> arg2 --> double --> Minutes to advance (Actual clock i.e 60 will result in the equivilant of 60 minutes passing irl in game)
functionality
--> Get the current clock with a time advancement (Does not modify the clock time)
returns
--> int[] --> Retuns a array/table with the clock time data (Format found at the bottom)
// exports["ProjectSA_WorldTime"]:HasClockPassed(arg1, arg2)
inputs
--> arg1 --> string --> Clock reference name
--> arg2 --> int[] --> array/table with the clock time data format (Found at the bottom)
functionality
--> Checks to see if the clock has passed a timestamp
returns
--> bool
--> true --> If the timestamp HAS passed
--> false --> If the clock hasnt passed the timestamp
// exports["ProjectSA_WorldTime"]:ClockGetSeason(arg1, arg2)
inputs
--> arg1 --> string --> Clock reference name
--> arg2 --> string[] --> array/table with the season data format (Found at the bottom)
functionality
--> Get what season a clock is in.
returns
--> string --> Returns the assigned season to the month
// exports["ProjectSA_WorldTime"]:ClockGetTime(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the current time
returns
--> string --> HOUR:MINUTE:SECOND
// exports["ProjectSA_WorldTime"]:ClockGetDateFormat1(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the current date
returns
--> string --> DAY.SUBDAY/MONTH/YEAR
// exports["ProjectSA_WorldTime"]:ClockGetDateFormat2(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the current date
returns
--> string --> MONTH/DAY.SUBDAY/YEAR
// exports["ProjectSA_WorldTime"]:ClockGetTimeAndDateFormat1(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the current time and date
returns
--> string --> HOUR:MINUTE:SECOND DAY.SUBDAY/MONTH/YEAR
// exports["ProjectSA_WorldTime"]:ClockGetTimeAndDateFormat2(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the current time and date
returns
--> string --> HOUR:MINUTE:SECOND MONTH/DAY.SUBDAY/YEAR
// exports["ProjectSA_WorldTime"]:SetGameClock(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Sets the game clock to a clock (What players game time is synced to)
--> The first clock created is automatically set to be the game clock, this is here so you can change the game clock
returns
--> Nothing
// exports["ProjectSA_WorldTime"]:ClockGetArray(arg1)
inputs
--> arg1 --> string --> Clock reference name
functionality
--> Returns the clocks array/table
returns
--> int[] --> array/table with the clock time data format (Found at the bottom)
// Array-table formats
-- ALL ELEMENTS OF THE ARRAY/TABLE ARE NUMBERS
clock time data = {
second,
minute,
hour,
subday,
day,
month,
year
}
-- ALL ELEMENTS OF THE ARRAY/TABLE ARE STRINGS
season data = {
"The season for January",
"The season for Febuary",
"The season for March",
"The season for April",
"The season for May",
"The season for June",
"The season for July",
"The season for August",
"The season for September",
"The season for October",
"The season for Novemeber",
"The season for December",
}
How would I use those exports?
exports["ProjectSA_WorldTime"]:CreateClock(8, 480, "UTC+8"); -- Creates a clock with the reference name "UTC+8", the clock has 8 days (Daycycle every 3 hours) in one calander day and is set ahead of UTC by 8 hours [60 * 8 = 480]
exports["ProjectSA_WorldTime"]:CreateClock(1, 480, "UTC+0"); -- Creates a clock with the reference name "UTC+8", the clock has 1 days (Realtime) in one calander day and is set ahead of UTC by 8 hours
-- From the above "UTC+8" is automatically set to the game clock. Below we will change it to be "UTC+0" so the server is based on realtime.
exports["ProjectSA_WorldTime"]:SetGameClock("UTC+0");
-- We no longer need "UTC+8" so we will destroy it below.
exports["ProjectSA_WorldTime"]:DestroyClock("UTC+8");
-- Someone has been jailed for 3 hours. When will they get out?
local outData = exports["ProjectSA_WorldTime"]:ClockGetModified("UTC+0", 180); -- Refers to 180 minutes in the game
local outDataRT = exports["ProjectSA_WorldTime"]:ClockGetModifiedRT("UTC+0", 180); -- Refers to 180 minutes in the real world, in this case due to realtime they are the same.
print(json.encode(outData));
print(json.encode(outDataRT));
-- The player wants to check if they are free
print(exports["ProjectSA_WorldTime"]:HasClockPassed("UTC+0", outData)); -- Prints true if the clock has past the timestamp, in this case it will print false because the "prison sentence" has only just started.
-- The player waits their sentence out and is now released. We want to store the release time.
print(json.encode(exports["ProjectSA_WorldTime"]:ClockGetArray("UTC+0"))); -- Prints the encoded array/table for the clock time of the target clock
print(exports["ProjectSA_WorldTime"]:ClockGetTimeAndDateFormat2("UTC+0")); -- Prints the current time and date for the target clock
Key Notes:
- The set game clock syncs with the player on join & every 1 minute
- There is no config due to the modular design (Functions basically act as the config)
- The example use of exports is included with the files
- Any assistance required to use this resource is included
- Requested features will be attempted to be included if they fit the design of the resource
- At this stage the exports are not available client side, however support is included to setup a Lua callback script to add this functionality (May be included by default later if request for this is high)
- This is a given but this version is not compatible with the Lua version
- Nothing is encrypted
- Does not include Lua version ([PAID] [Standalone] [Lua] World Time)
Where do I buy?
NO LONGER AVALIBLE
Code is accessible | Yes (Source is available for C# files if needed) |
Subscription-based | No (Single purchase includes all future upgrades and improvements) |
Lines (approximately) | 500+ |
Requirements | None |
Support | Yes |