πŸ—‘οΈTworst Garbage Job

Garbage Script Documentation

Region Dumpster Clean Coordinates (regionDumpsterCleanCoords)

  • coords: Defines the coordinate where the dumpster will spawn.

  • clean: Do not modify. This parameter is used to determine whether the dumpster has been cleaned.

  • open: Do not modify. Tracks whether the dumpster is open or not.

  • bagCoords: Defines two coordinates (usually on the right and left of the dumpster) where trash bags will spawn.

Region Trash Collect Coordinates (regionTrashCollectCoords)

  • coords: Specifies the coordinate where garbage items will spawn.

  • areaDistance: Determines the radius (in units) around the given coordinate where objects (garbage) will be generated. Players must collect items within this area.

Region Job Task (regionJobTask)

  • jobName: Do not modify. This is the identifier for the specific job.

  • jobBlipLabel: The name displayed on the map blip for the task.

  • jobCount: The total number of tasks (e.g., the number of items to collect or dumpsters to clean).

  • jobLabel: The name displayed in the top-left corner of the screen during the task.

Job Types:

  1. DumpsterClean: This job involves cleaning and emptying the dumpsters.

  2. BagClean: Requires collecting trash bags that spawn near the dumpsters and loading them into a vehicle.

  3. TrashCollect: Involves picking up garbage items from the ground.

Region Settings

  • regionMaxPlayer: Disabled. This parameter is not used.

  • regionMinimumLevel: Specifies the minimum level required to perform this job.

  • onlineJobExtraAwards: Same as the previously explained system. Determines bonus rewards for group tasks based on the number of players.

Spawn and Delivery Coordinates

  • regionSpawnCoords: The coordinate where the vehicle will spawn after the job starts.

  • regionDeliveryCoords: The coordinate where the vehicle must be delivered after completing the tasks.

Trash Collect Task (collectTrash)

  • Config.TrashModel:

    • This configuration defines the names of the garbage items that appear during the collectTrash task.

    • Items from this list are randomly selected to spawn at designated coordinates.

    • Examples include:

      • ng_proc_litter_plasbot1: A plastic bottle model.

      • ng_proc_litter_plasbot2: Another plastic bottle variation.

      • ng_proc_sodacan_01a: A soda can model.

      • ng_proc_sodacan_02a: A second soda can variation.

      • ng_proc_sodabot_01a: A soda bottle model.

The randomness adds variety to the task, making each garbage collection job feel slightly different while ensuring players encounter a mix of items.

Trash Bag Throw Settings (Config.TrowSetting)

This configuration controls the difficulty and mechanics of throwing trash bags onto the vehicle or into specific collection points. Below is a detailed explanation of each setting:


distance

  • Defines the proximity required between the trash bag and the garbage truck's bed for the system to consider the throw successful.

  • If the trash bag lands within the specified distance (1.9 units by default), the system will register it as "thrown successfully."


distancemachine

  • Similar to distance, but applies when throwing the trash bag into a recycling machine instead of a garbage truck.

  • If the trash bag lands within this distance (3.0 units by default), the system considers the throw successful.


basketoption

  • Controls whether the trash bag throw mechanic is enabled or not.

    • true: The mechanic is active, and players must manually aim and throw the trash bags.

    • false: The mechanic is disabled, and the trash bag will always be deleted after being launched. The mission will progress regardless of whether the throw hits the target or not.


falsebasketdistance

  • Only takes effect if basketoption is set to false.

  • If the trash bag lands within this distance (5.0 units by default) from the garbage truck's bed, the system will automatically delete the bag and register it as successfully thrown. This setting ensures that the job progresses smoothly without requiring precise throws.

Fixing Dumpster Freezing Issue During Garbage Job with qs-inventory

  1. Modify the garbage.lua File in qs-inventory:

    • Open the garbage.lua file in the qs-inventory script.

    • Locate the table that includes the dumpster model "prop_dumpster_01a".

    • Either remove this table entirely or comment it out by adding -- at the beginning of each line.

  2. Why Is This Necessary?

    • Both the garbage script and qs-inventory may be trying to interact with the same dumpster model ("prop_dumpster_01a"), causing a conflict.

    • By removing this model from qs-inventory, you ensure that only the garbage script manages these dumpsters, preventing them from freezing.

  3. Outcome:

    • The dumpsters will no longer freeze or get stuck during the garbage job.

--[[
    Welcome to the Garbage Settings Configuration!
    In this section, you’ll find settings related to garbage cans and their loot items. Each item listed
    under Config.GarbageItemsForProp will appear randomly when interacting with a garbage can, providing
    an immersive experience where players can search for random loot.

    **Config.GarbageObjects**:
    - This list contains object names used to represent garbage cans across the map.
    - These objects are registered for targeting. If your server doesn’t use targeting, feel free to ignore this.

    **Config.GarbageItemsForProp**:
    - This configuration maps specific garbage can models to lootable items.
    - Each object (like 'prop_dumpster_02a') has defined slots and random item possibilities.
    - The items assigned to each garbage object spawn with variable amounts, as set in each item’s configuration.
    - Adjust min and max amounts per item as desired to tailor gameplay rewards.
]]

Config.GarbageItems = {}

Config.GarbageObjects = {
    'prop_dumpster_02a',     -- Standard dumpster
    'prop_dumpster_4b',      -- Large blue dumpster
    'prop_dumpster_4a',      -- Large green dumpster
    'prop_dumpster_3a',      -- Smaller gray dumpster
    'prop_dumpster_02b',     -- Alternate dumpster model
}

Config.GarbageItemsForProp = {
    [joaat('prop_dumpster_02a')] = {
        label = 'Garbage',    -- Label shown to players when interacting
        slots = 30,           -- Number of item slots available in the dumpster
        items = {
            [1] = {
                [1] = {
                    name = 'aluminum',      -- Item name: aluminum scrap
                    amount = {
                        min = 1,           -- Minimum amount spawned per search
                        max = 5            -- Maximum amount spawned per search
                    },
                    info = {},              -- Additional item information
                    type = 'item',          -- Type of loot (e.g., 'item' or 'weapon')
                    slot = 1,               -- Slot position within the garbage inventory
                },
                [2] = {
                    name = 'metalscrap',    -- Item name: metal scrap
                    amount = {
                        min = 1,           -- Minimum amount spawned per search
                        max = 5            -- Maximum amount spawned per search
                    },
                    info = {},              -- Additional item information
                    type = 'item',          -- Type of loot (e.g., 'item' or 'weapon')
                    slot = 2,               -- Slot position within the garbage inventory
                },
            },
            [2] = {
                [1] = {
                    name = 'iron',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'steel',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
    [joaat('prop_dumpster_4b')] = {
        label = 'Garbage',
        slots = 30,
        items = {
            [1] = {
                [1] = {
                    name = 'aluminum',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'plastic',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
            [2] = {
                [1] = {
                    name = 'plastic',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
    [joaat('prop_dumpster_4a')] = {
        label = 'Garbage',
        slots = 30,
        items = {
            [1] = {
                [1] = {
                    name = 'aluminum',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
            [2] = {
                [1] = {
                    name = 'glass',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'joint',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
    [joaat('prop_dumpster_3a')] = {
        label = 'Garbage',
        slots = 30,
        items = {
            [1] = {
                [1] = {
                    name = 'aluminum',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'lighter',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
            [2] = {
                [1] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'rubber',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
    [joaat('prop_dumpster_02b')] = {
        label = 'Garbage',
        slots = 30,
        items = {
            [1] = {
                [1] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'rubber',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
            [2] = {
                [1] = {
                    name = 'iron',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'steel',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
    [joaat('prop_dumpster_02a')] = {
        label = 'Garbage',
        slots = 30,
        items = {
            [1] = {
                [1] = {
                    name = 'plastic',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
            [2] = {
                [1] = {
                    name = 'lighter',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 1,
                },
                [2] = {
                    name = 'metalscrap',
                    amount = {
                        min = 1,
                        max = 5
                    },
                    info = {},
                    type = 'item',
                    slot = 2,
                },
            },
        }
    },
}

Last updated