Tutorials (Code)

How create new activity?

Go to the config.lua file and find Config.CompaniesJobs.

Add this code to the table

Data info

  • Label - The name of the activity that you will see in the company administration.

  • Name - A unique name that you can use when creating a new job.

  • Public - Whether it will be available or will have to be set by admin.

  • Price - The price it will cost.

  • Tax - Daily payment per activity

  • Tax name - For accounting in company administration.

{
        label="My new job",
        name="newjob",
        public=true,
        price=0,
        tax=5000,
        taxname="Payment for new job"
 },

How to add a company overview for a police job.

Go to the config.lua file and find Config.CompaniesPoliceJobs

Here you set up an overview for police work or for a government office.

["police"] = { -- Jobn ame
        label = "Company list", -- Target label 
        coords = vector3(-1064.3923, -823.2276, 23.0332), -- Coords
        grade = 8, -- Job grade 
        permisions = {
            viewOwnerName = false, -- Can see owner name?
            viewMembers = true, -- Can see all members?
            viewBank = true, -- Can see bank status?
            viewActivities = false, -- Can see public activities
            viewInvoices = false, -- Can see invoices
            viewTaxes = false, -- Can see taxes
            deleteCompany = false, -- Can delete company?
        }
    },

How create new crafting table for warehouse?

You go to config.lua and find

Config.WarehouseFurnitureCraftings

You add the code to expand the table and set the items you need for production.

An unlimited number of production items can be added for one table.

["workbench"] = {
        items = {
            {
                name="final_item_name",
                count = 10,
                duration=30000,
                    needitems={
                    {
                        name="item_for_crafting_1",
                        count = 1,
                    },
                    {
                        name="item_for_crafting_2",
                        count=1,
                    }
                }
            },
            {
                name="final_item_name_2",
                count = 2,
                duration=30000,
                    needitems={
                    {
                        name="item_for_crafting_1",
                        count = 1,
                    },
                    {
                        name="item_for_crafting_2",
                        count=1,
                    }
                }
            },
        }, 
    },

We still need to bring crafting to the table.

Go to pls_companies/server/warehouse_data.lua

Find WarehouseData.Furniture

{
            label="Table label", -- Crafting table label
            name="workbench", -- UNIQ name from config.lua
            prop="prop_pool_rack_01", -- PROP
            price = 5000, -- Price for table
            type="crafting", -- Type crafting, storage, notusable(for chairs or something)
            limitedByActivity = false, -- Is limited by some activity from company table
            activity = "", -- If true enter activity name
            onlyvisual = false, -- Only visual true / false
        },

In WarehousesData.Furniture you will see the distribution in the following way.

This [1] divides the levels of the warehouse.

WarehousesData.Furniture = { 
    [1] = {
        {
            label="Table label", -- Crafting table label
            name="workbench", -- UNIQ name from config.lua
            prop="prop_pool_rack_01", -- PROP
            price = 5000, -- Price for table
            type="crafting", -- Type crafting, storage, notusable(for chairs or something)
            limitedByActivity = false, -- Is limited by some activity from company table
            activity = "", -- If true enter activity name
            onlyvisual = false, -- Only visual true / false
        },
    } 
}

What if the furniture is storage?

Just add the data settings

storageData = {
    weight = 50000,
    slots = 20,
}

Example

{
            label="Case (1)",
            name="smallchest",
            prop="ex_prop_adv_case",
            price = 40000,
            type="storage",
            limitedByActivity = false,
            activity = "",
            storageData = {
                weight = 50000,
                slots = 20,
            }
        },

Last updated