Development
RS Multi Storage exposes a server-side data API used by the included My Storages phone app. Every export validates the player source and storage ownership before returning or changing data.
Server Exports
Section titled โServer ExportsโPhone_GetMyStorages
Section titled โPhone_GetMyStoragesโReturns summaries for every player-owned storage.
local storages = exports['rs_multistorage']:Phone_GetMyStorages(source)
for _, storage in ipairs(storages) do print(storage.id, storage.type, storage.status, storage.fillPercent)endPhone_GetStorageDetail
Section titled โPhone_GetStorageDetailโReturns one owned storage with its name, note, status, position, fill percentage, and latest activity.
local detail = exports['rs_multistorage']:Phone_GetStorageDetail(source, storageId)
if detail then print(detail.customName or detail.typeLabel)endPhone_GetStorageLogs
Section titled โPhone_GetStorageLogsโReturns the latest activity entries for an owned storage. The maximum accepted amount is 50.
local logs = exports['rs_multistorage']:Phone_GetStorageLogs(source, storageId, 20)Storage Management Exports
Section titled โStorage Management Exportsโlocal waypoint = exports['rs_multistorage']:Phone_SetWaypointFor(source, storageId)
local renamed = exports['rs_multistorage']:Phone_RenameStorage(source, storageId, 'Warehouse Safe', { minLength = 1, maxLength = 24, rateLimitMs = 2000})
local note = exports['rs_multistorage']:Phone_SaveNote(source, storageId, 'Emergency supplies', { maxLength = 200})
local delivery = exports['rs_multistorage']:Phone_GetActiveDelivery(source)local cancelled = exports['rs_multistorage']:Phone_CancelDelivery(source, deliveryId)local position = exports['rs_multistorage']:Phone_GetStoragePosition(source, storageId)Public Hook Events
Section titled โPublic Hook EventsโOther server resources can listen to storage activity without editing the core files:
AddEventHandler('rs_multistorage:hook:storageOpened', function(payload) print(payload.storageId, payload.owner, payload.openerIdentifier)end)| Event | Trigger |
|---|---|
rs_multistorage:hook:storageOpened | A storage is opened |
rs_multistorage:hook:wrongPassword | A wrong password is entered |
rs_multistorage:hook:storageBreached | Police successfully breach a storage |
rs_multistorage:hook:storageRepaired | A damaged storage is repaired |
rs_multistorage:hook:portableBuried | A portable safe is buried |
rs_multistorage:hook:portableDugOut | A portable safe is recovered |
rs_multistorage:hook:deliveryArrived | The delivery NPC reaches the player |
rs_multistorage:hook:deliveryCompleted | A container is installed |
rs_multistorage:hook:alarmTriggered | A storage alarm is triggered |
rs_multistorage:hook:passwordChanged | A storage password is changed |
rs_multistorage:hook:keyCreated | New storage keys are created |
Custom Bridges
Section titled โCustom BridgesโUnsupported systems can be integrated through the editable bridge files:
bridge/framework/custom.luabridge/inventory/custom.luabridge/target/custom.luabridge/dispatch/custom.luaSelect the required custom bridge in shared/config.lua:
Config.Framework.type = 'custom'Config.Inventory.type = 'custom'Config.Target.type = 'custom'The custom framework bridge handles player identifiers, jobs, names, permissions, and notifications. The inventory bridge handles items, metadata, stashes, and weight. The target bridge handles entity options and zones, while the dispatch bridge handles optional heist alerts.