Keys/Chat/Events/Exports

Chat Commands

  • You can rename or disable these chat commands in the [configs/config.lua].

Command

Description

/easytime

The command for staff to open the UI.



Events

  • These events are entirely optional and can be used as needed.

Open UI

This event opens the UI, enabling players to access its features. A permissions check ensures that only authorized players can trigger it.
TriggerServerEvent('cd_easytime:OpenUI')



Exports

These exports are entirely optional and can be used as needed.


Get All Data

This export retrieves detailed weather, time and settings data from cd_easytime.
local data = exports['cd_easytime']:GetAllData()

print(data.weather) -- "EXTRASUNNY" [string]
print(data.hours) -- 08 [number]
print(data.mins) -- 00 [number]
print(data.freeze) -- true/false [boolean)
print(data.dynamic) -- true/false [boolean) 
print(data.blackout) -- true/false [boolean)
print(data.tsunami) -- true/false [boolean)
print(data.timemethod) -- "realtime"/"gametime" [string]
print(data.weathermethod) -- "realweather"/"gameweather" [string]

Explanation

This export returns a table containing the following information:

  • data.weather: The current in-game weather condition (string).

  • data.hours: The current hour (number).

  • data.mins: The current minutes (number).

  • data.freeze: Indicates if time/weather synchronization is frozen (boolean).

  • data.dynamic: Indicates if the weather is dynamic (boolean).

  • data.blackout: Indicates if a blackout is in effect (boolean).

  • data.tsunami: Indicates if a tsunami warning is active (boolean).

  • data.timemethod: The method of tracking time, either "realtime" or "gametime" (string).

  • data.weathermethod: The method of tracking weather, either "realweather" or "gameweather" (string).


Get Pause Sync State

This export returns a boolean indicating whether time and weather synchronization is paused, such as when a player has entered a shell.
local pause_sync = exports['cd_easytime']:GetPauseSyncState()

print(pause_sync) -- true/false [boolean]

Last updated

Logo

Codesign Software © All rights reserved