ScriptsM Trailer Storage
This script will allow you to put items in trailer and see how trailer is filled up ingame by props. Working with ox and qb inventories and target system
Installation
Download a resource (opens in a new tab) from keymaster or buy it by buttons at the top
Install all resource dependencies
- Ox Target (opens in a new tab) or
- Qb Target (opens in a new tab)
- QBCore (opens in a new tab) or
- ESX (opens in a new tab)
- InteractSound (opens in a new tab)
Resource start order
It's important for your resources to start in a logical order to prevent errors from missing dependencies.
start yourframework
start your_target_system
start InteractSound
start ScriptsM-TrailerStorage
Set up the InteractSound (opens in a new tab)
To get sounds working, you need to install sounds with .ogg format from zip archive following this guide:
- Add .ogg files from zip archive to InteractSound/client/html/sounds
- Open __resource.lua and modify following portion:
files({
'client/html/index.html',
-- Begin Sound Files Here...
-- client/html/sounds/*.ogg
...
})
- Now you are done with sounds
Config
There you can find an config of resource with description for all params
Config = {}
Config.StashOpenExport = function() -- Put your export to open stash, below you can see export for ox_inventory. Also change LoadStash event in bridge.lua if you need that.
-- OX INVENTORY
--TriggerServerEvent('ox:loadStashTrailer', platetext)
--exports.ox_inventory:openInventory('stash', platetext)
-- QB INVENTORY
TriggerServerEvent("inventory:server:OpenInventory", "stash", platetext, {label = 'Trailer', maxweight = stashweight, slots = stashslots})
TriggerEvent("inventory:client:SetCurrentStash", platetext, {label = 'Trailer', maxweight = stashweight, slots = stashslots})
end
Config.Framework = 'qb' -- qb/esx
Config.Inventory = 'ox' --ox/qb
Config.Target = 'qb' --qb/ox
Config.TargetText = 'Open trailer' -- Target text
Config.VehicleOptions = { -- There you can add your own vehicles, change interiors, stash coords and etc
{
modelname = 'trailersmall', --model name of your vehicle
StashSlots = 15,
StashWeight = 50000,
}
}
-- Props stage weight percent
Config.Stage1 = 0
Config.Stage2 = 10
Config.Stage3 = 20
Config.Stage4 = 30
Config.Stage5 = 40
Config.Stage6 = 50
Config.Stage7 = 60
Config.Stage8 = 70
Config.Stage9 = 80
Config.Stage10 = 90