Function or EventScopeDescriptionreturns
exports[‘rsg-core’]:AddItem(itemName, item)ServerAccepts an item name and item object - will add new entry to RSGCore.Shared.Itemsboolean, string
exports[‘rsg-core’]:AddJob(jobName, job)ServerAccepts an job name and job object - will add new entry to RSGCore.Shared.Jobsboolean, string
exports[‘rsg-core’]:AddGang(gangName, gang)ServerAccepts an gang name and gang object - will add new entry to RSGCore.Shared.Gangsboolean, string
exports[‘rsg-core’]:AddItems(items)ServerAccepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Itemsboolean, string, errorItem
exports[‘rsg-core’]:AddJobs(jobs)ServerAccepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Jobsboolean, string, errorItem
exports[‘rsg-core’]:AddGangs(gangs)ServerAccepts an item name and item object - will add new entry to RSGCore.Shared.Itemsboolean, string, errorItem
RSGCore.Functions.AddItem(itemName, item)ServerAccepts an item name and item object - will add new entry to RSGCore.Shared.Itemsboolean, string
RSGCore.Functions.AddJob(jobName, Job)ServerAccepts an job name and job object - will add new entry to RSGCore.Shared.Jobsboolean, string
RSGCore.Functions.AddGang(gangName, gang)ServerAccepts an gang name and gang object - will add new entry to RSGCore.Shared.Gangsboolean, string
RSGCore.Functions.AddItems(items)ServerAccepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Itemsboolean, string, errorItem
RSGCore.Functions.AddJobs(jobs)ServerAccepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Jobsboolean, string, errorItem
RSGCore.Functions.AddGangs(gangs)ServerAccepts a table or array - will loop through the table and add new entries to RSGCore.Shared.Gangsboolean, 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!

RegisterNetEvent('RSGCore:Client:UpdateObject', function()
	RSGCore = exports['rsg-core']:GetCoreObject()
end)

You must add this code to the server-side file of your resource when using these if you need the core object!

RegisterNetEvent('RSGCore:Server:UpdateObject', function()
	if source ~= '' then return false end
	RSGCore = exports['rsg-core']:GetCoreObject()
end)

RSGCore.Functions.AddJob

RSGCore.Functions.AddJob(jobName --[[string]], job --[[table]])

-- Example
RSGCore.Functions.AddJob('unemployed', {
    label = 'Civilian',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'Freelancer',
            payment = 3
        }
    }
})

exports[‘rsg-core’]:AddJob

exports['rsg-core']:AddJob(jobName --[[string]], job --[[table]])

-- Example
exports['rsg-core']:AddJob('unemployed', {
    label = 'Civilian',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'Freelancer',
            payment = 3
        }
    }
})

RSGCore.Functions.AddJobs

RSGCore.Functions.AddJobs(jobs --[[table]])

-- Example
RSGCore.Functions.AddJobs({
    ['unemployed'] = {
        label = 'Civilian',
        defaultDuty = true,
        offDutyPay = false,
        grades = {
            ['0'] = {
                name = 'Freelancer',
                payment = 3
        }
    },
    ['vallaw'] = {
	label = 'Valentine Law Enforcement',
	type = 'leo',
	defaultDuty = true,
	offDutyPay = false,
	grades = {
            ['0'] = {
                name = 'Recruit',
                payment = 7
        }
    }
})

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

RSGCore.Functions.AddGang(gangName --[[string]], gang --[[table]])

-- Example
RSGCore.Functions.AddGang('odriscoll', {
    label = 'O Driscoll Boys',
    grades = {
        ['0'] = {
            name = 'Recruit'
        }
    }
})

exports[‘rsg-core’]:AddGang

exports['rsg-core']:AddGang(gangName --[[string]], gang --[[table]])

-- Example
exports['rsg-core']:AddGang('odriscoll', {
    label = 'O Driscoll Boys',
    grades = {
        ['0'] = {
            name = 'Recruit'
        }
    }
})

QBCore.Functions.AddGangs

RSGCore.Functions.AddGangs(gangs --[[table]])

-- Example
RSGCore.Functions.AddGangs({
    ['odriscoll'] = {
        label = 'O Driscoll Boys',
        grades = {
            ['0'] = {
                name = 'Recruit'
            }
        }
    },
    ['lemoyne'] = {
        label = 'Lemoyne Raiders',
        grades = {
            ['0'] = {
                name = 'Recruit'
            }
        }
    }
})

exports[‘rsg-core’]:AddGangs

exports['rsg-core']:AddGangs(gangs --[[table]])

-- Example
exports[rsg-core']:AddGangs({
    ['odriscoll'] = {
        label = 'O Driscoll Boys',
        grades = {
            ['0'] = {
                name = 'Recruit'
            }
        }
    },
    ['lemoyne'] = {
        label = 'Lemoyne Raiders',
        grades = {
            ['0'] = {
                name = 'Recruit'
            }
        }
    }
})

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

RSGCore.Functions.AddItem

RSGCore.Functions.AddItem(itemName --[[string]], item --[[table]])

-- Example
RSGCore.Functions.AddItem('water', {
    name = 'water',
    label = 'Water',
    weight = 100,
    type = 'item',
    image = 'water.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'For all the thirsty out there'
})

exports[‘rsg-core’]:AddItem

exports['rsg-core']:AddItem(itemName --[[string]], item --[[table]])

-- Example
exports['rsg-core']:AddItem('water', {
    name = 'water',
    label = 'Drinkable Water',
    weight = 10,
    type = 'item',
    image = 'water.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'For all the thirsty out there'
})