Easytime

Step-by-step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL previews, and changelogs; all in 1 easily accessible place.

Download Here

FiveM Forums Post

YouTube Showcase Video

Translate

INSTALLATION GUIDE

1. Unzip the cd_easytime.zip folder and place this folder in your server's resource folder.

2. Before starting the script, please read the config.lua (this is located inside the main cd_easytime folder) and configure the script to suit your server's needs.

3. Add the resource to your server start config: ensure cd_easytime (it must be placed anywhere below your framework resource eg., es_extended, not above). The name of the folder must not be changed or the resource will not function correctly.

Step 1 - How do I use it?

The default command to open the UI is /easytime. It comes pre-configured for esx, qbus, vrp and ace permissions, you just need to add your desired permission groups in the Config.framework_perms in the configs/config.lua.

Step 2 - Persistent weather

The settings which are saved in the settings.txt file will automatically be applied on server start or script restart.

There are 3 ways to save the settings.

  1. Staff members with the correct permissions can use the "Save Settings" option on the UI when in-game.

  2. When the script is restarted the settings will automatically be saved.

  3. By triggering this server event below at least 30 seconds before a server restart.

TriggerServerEvent('cd_easytime:SaveSettings')

Step 3 - Shell support

If you do not use shells, ignore this step.

When a player enters/exits a shell you will need to trigger the client event below. So now when you enter a shell the time will change to 11 PM and the weather will change to CLEAR for the player's client to ensure there are no visual anomalies such as shadows or rain/snow etc inside the shell.

TriggerEvent('cd_easytime:PauseSync', true)

Step 4 - Tsunami warning

First, configure the Config.TsunamiWarning_time so the script knows how long the tsunami warning should last. Then this server event needs to be triggered x amount of minutes before a server restart.

Example: If you set the Config.TsunamiWarning_time to 2 minutes, then this event needs to be triggered 2 minutes before a server restart. The Halloween weather will start to change immediately, then the blackout and tsunami warning sound will start 90 seconds later.

Notes:

  • The blackout and tsunami warning will start when 3/4 of the Config.TsunamiWarning_time time has expired.

  • If you txAdmin's scheduled restart feature, you only need to configure the Config.TsunamiWarning_time, you do not need to trigger this event as this event will be triggered automatically.

TriggerEvent('cd_easytime:StartTsunamiCountdown', boolean)

Information

vMenu

The time and weather sync in vMenu must be disabled. To do this make sure your permissions.cfg of vMenu for the time and weather looks like this.

credits to J̫o̫e̫ M̫a̫m̫a̫#1570.

Exports

These exports are completely optional, you can use them if needed.

ExportDescription

exports['cd_easytime']:GetWeather()

Returns a table with all of the current weather data. This export can be used on both server and client side. Usage example.

SCRIPT NOT WORKING?

Common Issues

🔔 Folder Name Make sure the name of the folder is cd_easytime.

Screen Flickering If your screen is flickering while using cd_easytime, this is due to you having multiple time/weather sync scripts running at the same time fighting each other eg., vSync or vMenu.

✔️ Stop the other time/weather script that is causing this.

Permission Checks Error If you are having errors related to the permission checks for the /easytime command.

✔️ Look for the PermissionsCheck function in the server/server.lua. And make sure you have configured the Config.Framework_perms as mentioned in Step 1.

Footprints If players have footprints when the weather is not snowing (summer, clear etc).

✔️ This is because of a script you are using called fanox-hunting. Remove these 2 lines in the client side.

if Config.EnableFootprints then
    SetForcePedFootstepsTracks(true)
end

Troubleshooting

1. Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.

2. If none of the above worked, have a second read through the installation guide above, you may have missed something - you are only human.

If all else fails, contact the Codesign Team in the Codesign Discord.

CHANGELOG

Files Changed: Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.

  • All Files - This means you should delete your old cd_easytime folder, download and add in the latest version, reconfigure the configs folder and restart your server.

  • Specific Files - This means you can simply copy and paste the SPECIFIC new files over the old ones and restart the server.

20/03/2021 - 22/03/2021

v1.1.4 - v1.1.7

Files Changed:

Changelog:

Add

  • Added a version check to ensure you stay updated with the progress.

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.

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.

Last updated