Natural Disasters Resource

Natural Disasters (Normal / DLC 1, 2, 3, 4 & 5)

A guide to install Natural Disasters for FiveM

Just released: DLC 5!


Table of contents
  1. Purchasing the resource
  2. Installation Notice
  3. Downloading the resource
  4. Optional: Built in or external sound resources.
  5. Installing the resource
  6. Permissions
  7. Weather Compatibility
  8. How to add sound files for disasters?
  9. How to add sound files for the Air Raid Sirens?
  10. Exports
  11. Recommended!
  12. Support

Purchasing the resource

Find this product and it’s DLC’s at:

You require the base resource to be able to purchase DLC1. You require DLC1 resource to be able to purchase the DLC2. You require DLC2 resource to be able to purchase the DLC3. You require DLC3 resource to be able to purchase the DLC4. You require DLC4 resource to be able to purchase the DLC5.

Installation Notice

Got all of the Natural Disasters? Install just DLC5, this contains all code required. The latest resource is the one you install! The pack includes Air Raid Sirens which you can seperately install.

Downloading the resource

Download this resource via https://keymaster.fivem.net/asset-grants.

Optional: Built in or external sound resources.

  1. If you are using the built in sound system, skip this whole step and move on to ‘Installing the resource’.

  2. Drag “PlayCustomSounds” and/or “xsound” in your /resources/ folder. Download these from the creators. Using integrations? You will require both resources if you use Air Raid Sirens Integration: https://store.nights-software.com/package/5030134

  3. Ensure or start the resource in server.cfg. Example:
    ensure xsound
    

    xSound must be somewhere on top of server.cfg and preferably downloaded fresh from: https://github.com/Xogy/xsound PlayCustomSounds can be downloaded fresh from: https://github.com/LondonStudios/PlayCustomSounds

    • Note: Don’t forget to add the .ogg sound files, located in folder: SoundFiles (found in your purchased resource for Air Raid Sirens & Natural Disasters) to the sound resource (PlayCustomSounds). If you use xSound make sure to update c_functions.lua with your desired sound URL.
  4. Configure natural_disasters/config/config.lua in the next step and set the sound resource you are using to true and the other to false.

  5. Note: If you use xsound, use the dependency 'xsound' in fxmanifest.lua, otherwise comment it or leave it out. Example of a comment: -- dependency 'xsound'

  6. xSound must be installed fresh from https://github.com/Xogy/xsound

Installing the resource

Note: Always make sure when you transfer files to your server you follow this order: (Otherwise you will experience parsing errors in F8 console.)

ZIP Package -> Unpack in a folder on your local machine -> drag from local machine into the server resources folder -> server.cfg (ensure script) and then boot up the server.
  1. Drag the resource into your resources folder.
    • NOTE: If you are installing the DLC, replace the base resource! Overwrite it with the DLC!
  2. Carefully read the instructions given in natural_disasters/config/config.lua, it offers you all kinds of customization options!

  3. Ensure or start the resource in server.cfg. (Do not rename this script!) Example:
    ensure night_natural_disasters
    

Permissions

You have several permission options in config.lua:

  1. Discord API

  2. Ace Permissions: Ace Permissions Documentation

  3. QBCore or ESX, define the group names in the permission group/role list.

  4. Everyone has permission (Default)

Weather Compatibility

  1. If you are using the built in weather & time system, make sure to remove/disable any other weather/time systems on your server and then skip this step.

  2. If you do not use the built in weather and time system, you need to disable it in the config.lua and afterwards you will require a compatible one, described below.

You need @Customer roles in our Discord to see the channel link below: Claim your purchase or create a ticket in our Discord!

In our Discord we provide free weather script edits #free-files which in most cases you require to prevent flickering lights on your screen. This is due to your current weather file overwriting the weather the disaster is trying to set. The same goes for blackouts.

So alternative weather script compatibility is found in 3 alternative resources: qb-weathersync or cd_easytime or vSyncR (edits by Nights Software #free-files)

How to add sound files for disasters?

  1. Enter the NUI/sounds/ folder and drag your soundfile into this folder. After you’ve done that, head to config/config.lua and assign the file name without .ogg in the designated area.

How to add sound files for the Air Raid Sirens?

  1. Enter the night_air_raid_sirens folder and head to the NUI/sounds/ folder. Drag the sound file in there. Head back to night_natural_disasters and place the sound file name without .ogg in the SoundFileNameForAirRaidSirens = "yourfilename", variable.

Exports

  1. Serverside Exports
    exports.night_natural_disasters:SpawnDisaster(id)
    exports.night_natural_disasters:StopDisaster(id)
    exports.night_natural_disasters:NextWeatherStage()
    exports.night_natural_disasters:SetWeather(weatherType)
    exports.night_natural_disasters:SetTime(hour, minute)
    exports.night_natural_disasters:ToggleBlackout()
    exports.night_natural_disasters:ToggleFreezeTime()
    exports.night_natural_disasters:ToggleDynamicWeather()
    exports.night_natural_disasters:GetCurrentWeather() -- returns "EXTRASUNNY" for example (string)
    exports.night_natural_disasters:GetIsBlackoutActive() -- returns true or false (boolean)
    exports.night_natural_disasters:GetIsTimeFrozen() -- returns true or false (boolean)
    exports.night_natural_disasters:GetIsWeatherDynamic() -- returns true or false (boolean)
    exports[Config.Integrations.CustomSoundResource]:StartExternalSound(coords --[[Vector 3]], disasterID --[[index nr]], soundFileName --[[File name]], soundFileVolume --[[Volume]])
    
  2. Clientside Exports
    exports.night_natural_disasters:PauseSynchronization(boolean) -- Used by housing system scripts for weather & disaster proof interiors.
    

Support

Read through the instructions again if you have not managed to install the resource. Can’t get it to work still? Create a ticket through our dedicated support system in Discord:

Nights Software Discord


Back to top

Copyright © 2024 Nights Software

Page last modified: Jun 25 2022 at 12:31 AM.