RSG Core
📤 Shared Exports
Learn how to use exports to update the shared dynamically!
Function or Event | Scope | Description | returns |
---|---|---|---|
exports[‘rsg-core’]:AddItem(itemName, item) | Server | Accepts an item name and item object - will add new entry to RSGCore.Shared.Items | boolean, string |
exports[‘rsg-core’]:AddJob(jobName, job) | Server | Accepts an job name and job object - will add new entry to RSGCore.Shared.Jobs | boolean, string |
exports[‘rsg-core’]:AddGang(gangName, gang) | Server | Accepts an gang name and gang object - will add new entry to RSGCore.Shared.Gangs | boolean, string |
exports[‘rsg-core’]:AddItems(items) | Server | Accepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Items | boolean, string, errorItem |
exports[‘rsg-core’]:AddJobs(jobs) | Server | Accepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Jobs | boolean, string, errorItem |
exports[‘rsg-core’]:AddGangs(gangs) | Server | Accepts an item name and item object - will add new entry to RSGCore.Shared.Items | boolean, string, errorItem |
RSGCore.Functions.AddItem(itemName, item) | Server | Accepts an item name and item object - will add new entry to RSGCore.Shared.Items | boolean, string |
RSGCore.Functions.AddJob(jobName, Job) | Server | Accepts an job name and job object - will add new entry to RSGCore.Shared.Jobs | boolean, string |
RSGCore.Functions.AddGang(gangName, gang) | Server | Accepts an gang name and gang object - will add new entry to RSGCore.Shared.Gangs | boolean, string |
RSGCore.Functions.AddItems(items) | Server | Accepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Items | boolean, string, errorItem |
RSGCore.Functions.AddJobs(jobs) | Server | Accepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Jobs | boolean, string, errorItem |
RSGCore.Functions.AddGangs(gangs) | Server | Accepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Gangs | boolean, string, errorItem |
Import Jobs
- This method allows for any resource to insert job data into the shared file for the core. That means that you can make a resource, and on load, make those jobs available for use. This can be accomplished through one the ways shown below. Utilizing the function requires importing the core but using the export does not
Read over and learn the Shared structure before attempting to use these
You must add this code to the client-side file of your resource when using these if you need the core object!
You must add this code to the server-side file of your resource when using these if you need the core object!
RSGCore.Functions.AddJob
exports[‘rsg-core’]:AddJob
RSGCore.Functions.AddJobs
Import Gangs
- This method allows for any resource to insert gang data into the shared file for the core. That means that you can make a resource, and on load, make those gangs available for use. This can be accomplished through one the ways shown below. Utilizing the function requires importing the core but using the export does not
RSGCore.Functions.AddGang
exports[‘rsg-core’]:AddGang
QBCore.Functions.AddGangs
exports[‘rsg-core’]:AddGangs
Import Items
- This method allows for any resource to insert item data into the shared file for the core. That means that you can make a resource, and on load, make those items available for use. This can be accomplished through one the ways shown below. Utilizing the function requires importing the core but using the export does not