Targeting System

A targeting system is required to interact with the trailers and their various functions. This is where you can chose which system works best for you. Right now ox_target, qb-target, and inside-interaction are supported. You can configure a custom name if you've changed the default resource name and you can adjust the targeting distance. You can also set it to false for the classic GTA help message.

Config.Target = 'ox_target'             -- Targeting System: ox_target, qb-target, inside-interaction (Set to false to use the default GTA help message system)
Config.TargetName = false               -- Default: false - Targeting system resource name (if you changed the resource names of ox_target, qb-target, inside-interaction)
Config.TargetDistance = 5.0             -- Default: 5.0 - Targeting distance

NUI Text / Rage UI

You can enable or disable NUI Text in favor of the classic Rage UI help message as well adjust the position of the NUI text message.

Config.UseTextUI = true                 -- Use Text UI for help messages    
Config.TextUIPosition = "right-center"  -- Text UI Position: top-left, top-center, top-right, left-center, right-center, bottom-left, bottom-center, bottom-right

You can also change the keybind used for NUI Text / Rage UI help message (also changes the keybind for inside-interaction resource if you configured it)

Config.OtherKeybind = "E"              -- Keybind to toggle the help text message or inside-interaction (Default: E)

Any Trailer System

I highly recommend keeping this enabled. This will allow trailers to be attached to trucks that haven't been configured in their metas to do so. As long as the appropriate bones exist it will attach

Config.AllowConnectAny = true           -- Allow attaching any trailer

You can enable/disable the connect message when approaching an attachable trailer. You can also adjust the distance in which the trailers can connect. Secondary trailers default to 0.6 because of how they work and they and their unsupported nature naturally in the rage engine. Secondary trailers also require the connecting model names to be configured in their respective meta files.

Config.ConnectMessage = false           -- Enable or disable the connect message
Config.ConnectDistance = 4.0            -- Distance to check for a trailer bone (Defaults to 0.6 for double trailers)
Config.ConnectKeybind = "J"             -- Keybind to connect any compatible trailer (Default: J)

Attachment Helpers

These settings will enable/disable the help markers displayed on the attachment bones of both the trailers and trucks to help players connect them. They will turn red to green when they can be attached. You can also adjust the size of the markers.

Config.AttachHelpers = {
    Enable = true,                      -- Enable or disable the attach helpers
    Size = vec3(0.4, 0.4, 0.6),         -- Size of the attach helper
}

Static Helpers

Enable/Disable the static trailer helper/marker drawn at the loading point of configured trailers. You can also adjust the size of the marker

Config.StaticHelper = {
    Enable = true,                      -- Enable or disable the rampless helper marker
    Size = vec3(4.0, 8.0, 1.0),         -- Size of the rampless helper
}

B-Train / Double Trailers

This system allows for for more than one trailer to attach to each other. Theoretically you could have as many as you want. Note: The more trailers you connect to each other the harder things will become such as moving in reverse

You can enable/disable the system. You can change the limit of trailers in a total link. You can enable/disable player invisibility when attempting the link. Because of the nature of how this works, I highly suggest keeping this enabled if possible. You can adjust the max attempts, dont set this too high or else players will be spending a lot of time attempting to double connect trailers if they aren't aligned well enough to make the connection.

Keeping the helpers enabled will make this process easier. I've built a robust system to make this as seamless as possible, guiding players through it.

Config.BTrain = {                       -- BTrain/Double trailer system
    Enable = true,                      -- Enable or disable the BTrain system
    Limit = 6,                          -- Number of trailers allowed to be attached to a B-Train
    AllowInvisible = true,              -- Allow setting the player invisible while double trailer attempts are made
    Attempts = 3,                       -- Number of attempts to attached a double trailer (If exists)
}

Trailer Attachment

Enable/Disable the attach message. You can also change the keybind to attach vehicles to trailers. They will be frozen in place when done so and can be accessed with the menu through the targeting system. You can also change the attachment distance for boat trailers since many of them are sometimes too small not allowing the craft to fit in its bounding box

Config.AttachMessage = true             -- Enable or disable the attach message
Config.AttachKeybind = "E"              -- Keybind to attach/detach to/from trailer (Default: E)
Config.AttachDistance = 5.0             -- Attach dstance for boat and static trailers

Trailers

You will be able enable/disable a forced whitelist. This means that trailers will not work with this system unless they are configured to do so. I highly suggest configuring all of your trailers with this mechanic to ensure they are fully supported giving your players the best experience.

Config.ForcedWhitelist = false          -- Force whitelist trailers only

You can blacklist specific trailer beds. This is useful to make sure sure flatbeds used in a flatbed script do not conflict with the mechanics of this script.

Config.TrailerBlacklist = {             -- Trailer Blacklist (If you want to blacklist a trailer. Typically flatbeds for a flatbed script)
-- [`112towmfd5`] = true,
}

I have located over 40+ trailers and pre configured them to work with this system, a majority of them being custom addon trailers that you will need to find on your own. You can also add you own and I encourage you to share your custom configurations via our discord for others to find.

  • isBoat: Specifies whether or not the trail is for boats only

  • isDolly: Specifies if the trailer is strictly a dolly.. I have employed a special mechanic to make these easier to use, and setting this to true would enable those mechanics

  • onAttachedExtras: These extras will be enabled with the trailer is successfully attached

  • ramp: information for the targeting system's menu to control doors, lifts, and ramps on a trailer

    • label: name of the door/lift/ramp

    • instant: Specifies whether or not doors should be closed instantly for special use cases

    • doors: Doors ID's to be opened and closed

    • wait: This is a small wait time after doors are opened or closed to allow completion before other special mechanics are triggered to ensure a seamless experience. (An example would be a lift moving up and down slowly)

    • extras: These are vehicle extra ID's you want to trigger on open and close. (Some trailers use extras instead of doors.. and some use both. This system will support any case)

    • extrasHealth: A small trick when some trailers require a repair for the extra to appear. Enable this ONLY when that's required.

  • static: Configure static trailers of maybe add static loading point for unreachable parts of the trailer.

    • load: This is the point where the vehicle will be loaded onto the trailer, or placed when unloaded.

    • bed: This table will contain all of the static mounting/attachment points on the bed of the trailer. Max load calculations will be done automatically when trying to load a new vehicle onto the trailer.

Config.Trailers = {                     -- Trailer Whitelist & Trailer Info
  [`MODEL_NAME`] = {
      isBoat = false,                 -- Is the trailer a boat trailer
      isDolly = false,                -- Force the dolly direction until attached to another trailer (ONLY USE FOR DOLLYS)   
      onAttachedExtras = {},          -- Extras to enable when a vehicle is attached to the trailer
      ramp = {                        -- Ramp Configuration (Can add multiple ramps/doors/lifts) (Set to false if there is none)
          {                           -- Ramp/Door 1  
              label = 'Ramp & Doors', -- Label for the ramp
              instant = false,        -- Instantly close the ramp when the close button is pressed
              doors = {5, 4},         -- Door ID's to open/close when the ramp is opened/closed
              wait = 1500,            -- Wait time between open/close functions to employ some special mechanics
              extras = {},            -- Extras to enable when the ramp is opened/closed
              extrasHealth = false,   -- Initiate a simple repair on the extras when the ramp is opened/closed
          },
      },
      static = {                      -- Static Configuration (Set to false if there is none)
          load = {offset = vec3(0.0, 0.0, 0.0), rotation = vec3(0.0, 0.0, 0.0)},  -- Load Position
          bed = {
              {offset = vec3(0.0, 0.0, 0.0), rotation = vec3(0.0, 0.0, 0.0)},     -- Bed Position 1
              {offset = vec3(0.0, 0.0, 0.0), rotation = vec3(0.0, 0.0, 0.0)}      -- Bed Position 2
         }
      },
  },
}

Last updated