# Easytime

[**Download Here**](https://github.com/dsheedes/cd_easytime)

[**FiveM Forums Post**](https://forum.cfx.re/t/release-free-easytime-time-and-weather-management-by-codesign/1790503/)

[**YouTube Showcase Video**](https://youtu.be/-7SMZLyZWcY)

#### Translate

* [Click here to translate this page.](https://docs-codesign-pro.translate.goog/free-scripts/easytime-time-and-weather-management?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en-GB&_x_tr_pto=nui)
* [How do I change language?](https://gyazo.com/38606313ac9a7c290dc2c72b6793bde6)

***

***

## INSTALLATION GUIDE

### Step 1 - Download <a href="#step-1-download" id="step-1-download"></a>

{% hint style="info" %}
**1.** Download your resource from [GitHub](https://github.com/dsheedes/cd_easytime).

**2.** Unzip the `cd_easytime.zip` folder and place this folder in your server's resource folder.

**3.** Add the resource to your server start config (server.cfg). Make sure `cd_easytime` is listed below your framework resource e.g., es\_extended, not above it.

```
ensure es_extended
ensure cd_easytime
```

***

{% endhint %}

***

### Step 2 - Fxmanifest

{% hint style="info" %}
Depending on your framework and dependencies, you may need to make some changes inside `[cd_easytime/fxmanifest.lua]`. We have simplified this process by [commenting](https://i.imgur.com/bbb0dam.png) on the lines that you may need to modify.
{% endhint %}

***

### Step 3 - Configure Resource <a href="#step-3-configure-resource" id="step-3-configure-resource"></a>

{% hint style="info" %}
You **must** read all configurable options inside `[cd_easytime/configs/config.lua]` and adjust them to fit your server's needs. Please pay attention to the ["commented out help text"](https://i.imgur.com/QCja8UZ.png) at the end of each line to understand the purpose of each config option.

The most important sections are those under the [**Framework**](https://i.imgur.com/4ukCTZr.png) and [**Important**](https://i.imgur.com/IVm7E8l.png) categories at the top of the `config.lua`. Everything else is optional.
{% endhint %}

***

### Step 4 - How Do I Use It?

{% hint style="info" %}

* **Open the User Interface**:
  * To access the UI, use the command: `/easytime`.

* **Permissions**:
  * The script comes pre-configured to work with several frameworks, including ESX, QBCore, QBox, vRP, ACE permissions, and specific user identifiers for flexible permission management.
  * To set up the desired permission groups:
    1. Open the `[cd_easytime/configs/config.lua]`.
    2. Find the line that says `Config.Permissions`.
    3. Add the permission groups you want to allow access to the UI.
       {% endhint %}

***

### Step 5 - Real Time & Weather

{% hint style="warning" %}
Easytime **does not require** a paid plan on Open Weather Map!

It is designed with the free plan in mind.
{% endhint %}

{% hint style="info" %}

1. Go to [https://openweathermap.org](https://openweathermap.org/) and create an account.
2. The API key should be automatically generated after account creation. \
   To access it click on your profile name > [My API Keys](https://home.openweathermap.org/api_keys)\
   Double click the key and copy it.
3. Paste this API key into `Config.APIKey`.
4. Set `Config.Time.METHOD` and/or `Config.Weather.METHOD` to **"game"** and configure to suit your servers needs.<br>
   {% endhint %}

{% hint style="info" %}
The free limit on OpenWeatherMap is

* 60 requests per second
* 1 million requests per month

Easytime should never exceed these limits, since by default it only makes 1 request every 30 minutes.
{% endhint %}

***

## COMMON ISSUES

Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.

<mark style="color:red;">🔔</mark> <mark style="color:red;"></mark><mark style="color:red;">**Folder Name**</mark> Make sure the name of the folder is `cd_easytime`.

<mark style="color:red;">🔔</mark> <mark style="color:red;"></mark><mark style="color:red;">**Encrypted Files**</mark> Do not edit the encrypted files in any way.

> **Screen Flickering?**
>
> eg., if your screen is flickering while using cd\_easytime.
>
> {% code overflow="wrap" %}
>
> ```
> ✔️ This issue is caused by having multiple time or weather synchronization scripts running simultaneously, which conflict with each other (e.g., vSync or vMenu). To resolve this, please disable the other time or weather synchronization script that is causing the conflict.
> ```
>
> {% endcode %}

> **Permission Checks Error?**
>
> eg., if you are having errors related to the permission checks for the /easytime command.
>
> {% code overflow="wrap" %}
>
> ```
> ✔️ If you are experiencing errors related to permission checks for the /easytime command, ensure that the appropriate permission groups are correctly configured in the Config.Command.Perms in the config.lua file. Or check the PermissionsCheck function in the server.lua.
> ```
>
> {% endcode %}

> **Footprints?**
>
> eg., if players are seeing footprints when the weather is not snowing (e.g., during summer or clear weather).
>
> {% code overflow="wrap" %}
>
> ```
> ✔️ This is due to a conflict with a script you are using called fanox-hunting. To resolve this issue, remove the following two lines from the client-side of the script:
>
> if Config.EnableFootprints then
>     SetForcePedFootstepsTracks(true)
> end
> ```
>
> {% endcode %}

***

***

## CHANGELOG

> **Files Changed**
>
> Not every update requires replacing the entire folder, as we understand it’s a hassle to redo configs for each update.

* **All Files:** Delete the old `cd_easytime` folder, download the latest version, reconfigure the configs folder, and restart your server.
* **All Files Except config.lua:** Follow the steps above, but first back up your existing `config.lua` file. After downloading, replace the new `config.lua` with your backup.
* **Specific Files:** Simply copy and paste the specific updated files over the old ones, then restart your server.

{% hint style="warning" %}
**Skipping Updates**

If you’ve skipped previous updates, it’s best to update all files to ensure compatibility. For example, if you're on v4.0.1, skipped v4.0.2, and now want to update to v4.0.3, use the "All Files" method for safety.
{% endhint %}

{% tabs %}
{% tab title="v1.1.4" %}

### 20/03/2021 - 22/03/2021

v1.1.4 - v1.1.7

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
**Add**

* Added a version check to ensure you stay updated with the progress.
  {% endhint %}

{% hint style="info" %}
**Edit**

* Reworked the FORCED time changes so the changes are a lot smother.
* Reworked the natural weather changes so the changes are **a lot** smoother and barely noticeable.
* Reworded the config to be a bit more user friendly.
* Added a wait before syncing a players time and weather to ensure stability.
  {% endhint %}

{% hint style="warning" %}
**Fix**

* Fixed a typo in causing the time cycle to speed up.
* Fixed a small issue which would cause the weather to change to clear Instantly when entering a shell due to the pervious updates.
* File clean-up, removed the old client file which was renamed.
* Fixed a typo in the client.lua causing a error.
  {% endhint %}
  {% endtab %}

{% tab title="v1.2.0" %}

### **15**/05/2021 - 29/06/2021

v1.2.0 - v1.2.1

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
**Add**

* Added the ability to toggle the instant time and weather change on the in game UI instead of it being a config option, meaning you can choose whether you want to instantly change  the time or make the time change slowly so its barely noticeable to players in game.
* Added a new config option to allow you to walk around while the UI is open.
* Added a fail safe check to make sure the time and weather is synced when a player joins the server.
* Added drag and drop compatibility for qbus and ace permissions (read [Step 1](https://docs.codesign.pro/free-scripts/easytime-time-and-weather-management#step-1-how-do-i-use) for more information).
* The settings now automatically save when the script is restarted.
  {% endhint %}

{% hint style="info" %}
**Edit**

* Now when you click the "Save Settings" button on the in game UI, your chosen settings will be saved to the settings.txt file and applied in game, then the UI will close. (previously you needed to open the UI, choose your settings, click the "Change" button, reopen the UI and then click the "Save Settings" button).
* Edited the Config.NUI\_keepinput to disable mouse movement and punching/firing weapons while the UI is open.
  {% endhint %}

{% hint style="warning" %}
**Fix**

* Fixed time not syncing for new players when the FreezeTime option is enabled.
  {% endhint %}
  {% endtab %}

{% tab title="v1.3.0" %}

### **18**/12/2021

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
**Add**

* **Tsunami warning (pre-restart warning):** This feature adds visual and sound effects to warn players that a server restart is about to happen while keeping it in-character. It changes the weather to Halloween, then shortly after it enables a city wide blackout and plays a tsunami warning alert sound just before the server restart.
* Added pre-set permissions for each framework config option.
  {% endhint %}

{% hint style="info" %}
**Edit**

* Rewrote parts of the script as some were outdated.
  {% endhint %}

{% hint style="warning" %}
**Fix**

* Fixed issues with the weather not being synced on ESX/QBCore servers.
* Other minor bug fixes.

{% endhint %}
{% endtab %}

{% tab title="v1.3.1" %}

### **22**/12/2021

**Files Changed:**&#x20;

* [ ] All files
* [x] Specific Files

```lua
fxmanifest.lua
server/server.lua
```

**Changelog:**

{% hint style="warning" %}
**Fix**

* Reverted a change that caused the tsunami warning to have issues.
* Implemented a fix from a previous GitHub pull request to fix an issue with dynamic weather.
  {% endhint %}
  {% endtab %}

{% tab title="v1.3.3" %}

### **20**/04/2022

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
**Add**

* Added a option to use a identifier based permission system (steam/license).
* Added a new config option to allow vehicles lights to stay turned on during blackouts.
  {% endhint %}

{% hint style="info" %}
**Edit**

* Updated the blackout native.
* Removed unused framework job code.
  {% endhint %}

{% hint style="warning" %}
**Fix**

* Fixed QBCore perms.
* Fixed aceperms.
  {% endhint %}
  {% endtab %}

{% tab title="v1.3.4" %}

### **28**/04/2022

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
**Add**

* Added drag-and-drop compatibility for cd\_easytime to be used on QBCore servers and in replacement for vSync, meaning; dependencies don't need to be removed and events don't need changing when switching from QBCore or vSync to cd\_easytime.
  {% endhint %}

{% hint style="warning" %}
**Fix**

* Fixed the time and weather not changing when clicking the "Save Settings button".
* Fixed the client-side errors related to users not being on a high enough game build to support the new blackout natives.
  {% endhint %}
  {% endtab %}

{% tab title="v1.3.5" %}

### **02**/05/2022

**Files Changed:**&#x20;

* [ ] All files
* [x] Specific Files

```lua
fxmanifest.lua
server/server.lua
```

**Changelog:**

{% hint style="warning" %}
**Fix**

* Minor typo fix - [geeknessfr](https://github.com/dsheedes/cd_easytime/pull/17)
  {% endhint %}
  {% endtab %}

{% tab title="v1.3.6" %}

### **13**/06/2022

**Files Changed:**&#x20;

* [ ] All files
* [x] Specific Files

```lua
fxmanifest.lua
server/server.lua
client/client.lua
```

**Changelog:**

{% hint style="success" %}
**Add**

* Added server and client exports to get the weather data. [See docs.](#exports)
  {% endhint %}
  {% endtab %}

{% tab title="1.3.7" %}

### **15**/02/2023

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="warning" %}
**Fix**

* Fixed esx depreciated event warnings.
* Fix the issue with dynamic weather not loading correctly if false. Credits - JanBlk.
* Re-enable driveby after menu access and set clock speed for time sync. Credits - elenawinters.
  {% endhint %}
  {% endtab %}

{% tab title="2.0.0" %}

### 31/7/2025

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="success" %}
Add

* Added **Real Time** and **Real Weather**. The can be used together or independently, such as game time but real life weather.
* Added auto detect for framework and notification resources.
* Added discord roles as a permission method.
* Added QBox compatibiliy.
  {% endhint %}

{% hint style="info" %}
Edit

* Time changes (minute to minute) are much smother now.
  {% endhint %}
  {% endtab %}

{% tab title="v2.0.1" %}

### 2/9/2025

**Files Changed:**&#x20;

* [x] All files
* [ ] Specific Files

**Changelog:**

{% hint style="warning" %}
Fix

* Fixed time and weather syncing issues.
  {% endhint %}
  {% endtab %}
  {% endtabs %}
