HRScripts Documentation
  • HRScripts Documentation
  • Resources
    • 📚HRLib
      • Classes
        • HRLibConfig
        • HRLibClientFPlayer
        • HRLibServerFPlayer
        • HRLibClientIPlayer
        • HRLibServerIPlayer
        • HRLibCloseIPlayer
        • HRLibCloseFPlayer
        • HRLibBlipOptions
        • HRLibBlipForCoordOptions
        • HRLibBlipForEntityOptions
        • HRLibBlipForAreaOptions
        • HRLibBlipForPickupOptions
        • HRLibInputDialogueTextOptions
        • HRLibVehicleProperties
      • Modules
        • Bridge
          • Shared
          • Client
          • Server
        • Callbacks
          • Shared
          • Client
          • Server
        • Closest
          • Client
        • Controls Disable
          • Client
        • CreateBlip
          • Client
        • DiscordMsg
          • Server
        • DoesIdExist
          • Shared
        • FPlayer
          • Shared
          • Client
          • Server
        • GetPedsInVehicle
          • Client
        • GetPedWeapons
          • Client
        • GetPlayers
          • Client
        • GetVehicleDoorStatus
          • Client
        • GetVehicleFromPlate
          • Client
        • Interface
          • Client
          • Server
        • IPlayer
          • Client
          • Server
        • PlayerIdentifiers
          • Server
        • RadomValueWithNoRepetition
          • Shared
        • RegCommand
          • Client
          • Server
        • Resource
          • Shared
          • Server
        • SpawnVehicle
          • Shared
        • Streaming
          • Client
        • string
          • Shared
        • table
          • Shared
        • ToVector
          • Shared
        • TrackingEntities
          • Client
            • Functions
            • Events
        • Values
          • Shared
          • Client
        • VehicleProperties
          • Client
          • Server
        • SetDefaultPedVariation
          • Shared
    • HRGarages
      • Classes
        • HRGaragesConfig
        • HRGaragesVehicleInfo
        • HRGaragesClientFunctions
      • Exports
        • Server
    • 📦HRStorages
      • Exports
        • Client
        • Server
      • Callbacks
      • Commands
    • 🧹HRComserv
    • 🥷HRHostage
    • HRAdminMenu
      • Events
      • Exports
        • Client
        • Server
      • State Bags
    • ☑️HRWhitelist
    • HRExtraCommands
    • 🚦HRRealisticTraffic
    • 🗣️HRNPCDialogue
      • Classes
Powered by GitBook
On this page
  • Installation
  • Configuration
  • Get functions list methods
  • Export method
  • Import method
  • Translation system
  • Installation
  1. Resources

HRLib

FiveM library, used in all HRScripts resources, focused in providing common code in different scripts as functions to ensure better performance and optimization

PreviousHRScripts DocumentationNextClasses

Last updated 1 month ago

Installation

  • Download

  • Configure its config.lua file

  • Add ensure HRLib to the top of the list with resources to start in your server.cfg

  • Restart your server

Configuration

Here we allow you to see what you're about to configure before starting HRLib

local config = {}

config.defaultWebHook = 'https://discord.com/api/webhooks/********************' -- Default webhook URL for the `HRLib.DiscordMsg` function (not required)

config.defaultNotificationsPosition = 'left-center' -- available positions - 'top-right', 'center-right', 'bottom-right', 'frombelow-right', 'top-left', 'left-center', 'frombelow-left'

config.defaultProgressBarPosition = 'bottom-center' -- available positions - 'center-left', 'center', 'center-right', 'bottom-left', 'bottom-center', 'bottom-right'

config.alertDialogueTranslation = {
    agreeButton = 'Agree',
    cancelButton = 'Cancel'
}

config.inputDialogueTranslation = {
    confirmButton = 'Confirm',
    cancelButton = 'Cancel'
}

config.debug = {
    enable = true,
    commandName = 'hrlib_debug',
    commandHelp = 'Debug command of HRLib',
    args = {
        type = {
            name = 'functionType',
            help = 'Available types: showTextUI, isTextUIOpen, hideTextUI, progressBar, alertDialogue, inputDialogue, notify'
        },
        secondParameter = {
            name = '...',
            help = 'it changes according to the chosen function type'
        }
    }
}

Get functions list methods

Export method

HRLib = exports.HRLib:getLibFunctions()

Import method

Add this to your fxmanifest.lua:

shared_script '@HRLib/import.lua'

Translation system

The translation system allows you to translate your scripts, more organized and optimized.

Installation

  • Create your own translation.lua file directly into your script's folder

  • Add this to your fxmanifest.lua file 'translation.lua'

  • Create your own config.lua file which should provide global variable Config or local one and should return it at the end of the file (as import module) but it's supposed to return the config table with a field language if not in that way, the global Config variable must have the language field in it so the translation can work properly

  • Add this to your fxmanifest.lua If you choose to do it with global variable, add this: shared_script 'config.lua' (add it after the row with adding the import method) If you choose to do it with the local variable and return the config, add this: files { 'translation.lua', 'config.lua' }

  • Refresh & Restart the script

The translation is only available in import method!

📚
HRLib