Configuration

All spoodyCreations resources are tailored to support a all different types of configurations & settings, here below is our configuration file you may use for assistance.

ESX = exports['es_extended']:getSharedObject()

---@alias types 'success' | 'inform' | 'error'

Configuration = {
    ---@param message string
    ---@param type 'error' | 'warning' | 'inform' | 'success'
    Notify = function(message, type)
        lib.notify({
            title = 'Gun Plug',
            description = message,
            type = type,
            position = 'top'
        })
    end,

    Settings = {
        --- Do you want Text UI ? Or Ox Target?
        OxType = 'target', ---@type 'textui' | 'target'

        Job = {
            ---@type 'job' | 'discord' | 'none '
            Method = 'job',
            MethodID = 'gunplug', --- The ID of the method (job name, or Discord role ID)
            MethodResource = '', --- Discord API Resource goes here (leave blank if not using Discord Roles)
        },

        InventoryImagePath = 'nui://ox_inventory/web/images/', --- The file path to your images (IMPORTANT)

        Generator = {
            Enabled = true, --- Do players need a generator?
            BurnRate = 1.5, --- Burn 1.5% of fuel every interval?
            BurnInterval = 25000, --- Burn fuel every 25 seconds [in ms]
            Refuel = true, --- Allow the player to use fuel to refuel the generator?
        },

        Interactions = {
            --- NOTICE: Only Ox Inventory supports wepaon repairing.
            Repair = {
                RepairWeapons = true, --- Allow gun plugs to repair weapons?
                RepairDurability = 80.0, --- Only allow the player to repair weapons less than 80% durability?
                RepairResults = { min = 80, max = 100}, --- What should the resutls be? (it will choose a random from 80%-100% repair results)
            },

            ProductionFee = {
                Weapon = 1500, --- How much is the production fee to produce weapons? [each]
                Ammo = 100, --- How much is the production fee to produce ammo? [total]
                Attachment = 500, --- How much is the production fee to 3D print? [each]
                Account = 'money', ---@type 'money' | 'dirty' | 'bank'
            },

            Timers = {
                CreateWeapon = 25000, --- How long does it take to create a weapon? (25secs default)
                CreateAmmo = 30000, --- How long does it take to create ammo? (30secs default)
                CreateAttachment = 25000, --- How long does it take to 3D Print? (25secs default)
                RefuelGenerator = 15000, --- How long does it take to refuel a generator? (15secs default)
                RepairWeapon = 25000, --- How long does it take to repair a weapon? (25secs default)
            }
        },
    },

    Shops = {
        ['Machinery Shop'] = {
            Enabled = true, --- Enable the built in shop?
            Coords = vec3(368.9699, -2452.3030, 6.1219),

            Ped = {
                Coords = vec3(370.5171, -2452.2947, 6.6890),
                Heading = 93.4357,
                Hash = 's_m_y_construct_02',
            },

            Options = {
                { label = 'CNC Machine', item = 'cncmachine', price = 8500 },
                { label = 'Bullet Press', item = 'bulletpress', price = 6500 },
                { label = '3D Printer', item = '3dprinter', price = 5000 },
                { label = 'Generator', item = 'generator', price = 1250 },
            }
        },

        ['Gunsmith Shop'] = {
            Enabled = true, --- Enable the built in shop?
            Coords = vec3(490.0693, -801.2311, 24.8954), --- Coordinates of the shop?

            Ped = {
                Coords = vec3(488.9703, -801.3627, 24.9862), --- Coordinates of the Ped
                Heading = 274.5427, --- Heading (direction) of the ped
                Hash = 'ig_chef2', --- Ped Hash
            },

            Options = {
                { label = 'Weapon Parts', item = 'weaponparts', price = 900 },
                { label = 'Gun Powder', item = 'gunpowder', price = 150 },
                { label = 'Brass Casings', item = 'brasscasing', price = 200 },
                { label = 'Polymer Filamen', item = 'polymerfilament', price = 50 },
                { label = 'Generator Fuel', item = 'generatorfuel', price = 150 },
                { label = 'Weapon Repair Kit', item = 'gunrepairkit', price = 2500, },
            }
        },
    },

    Products = {
        Weapons = {
            -- If you'd like to add your own weapons, you can do so here (DEFAULT: GTAV Weapons)
            -- Pre-configured weapons can be accessed in this folder: (spoodyGunPlug/intall me/weapon configs/)
            ["Pistol"] = {
                item = "weapon_pistol",
                count = 5,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 3 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["Combat Pistol"] = {
                item = "weapon_combatpistol",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 4 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["SNS Pistol"] = {
                item = "weapon_snspistol",
                count = 6,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 2 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["Heavy Pistol"] = {
                item = "weapon_heavypistol",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Vintage Pistol"] = {
                item = "weapon_vintagepistol",
                count = 5,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 3 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["Revolver"] = {
                item = "weapon_revolver",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Micro SMG"] = {
                item = "weapon_microsmg",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 6 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["SMG"] = {
                item = "weapon_smg",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 7 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 3 },
                },
            },

            ["Tec-9 (Machine Pistol)"] = {
                item = "weapon_machinepistol",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 6 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Compact Rifle"] = {
                item = "weapon_compactrifle",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 8 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 3 },
                },
            },

            ["Assault Rifle"] = {
                item = "weapon_assaultrifle",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 10 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Carbine Rifle"] = {
                item = "weapon_carbinerifle",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 10 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Pump Shotgun"] = {
                item = "weapon_pumpshotgun",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 6 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 3 },
                },
            },

            ["Sawed-Off Shotgun"] = {
                item = "weapon_sawnoffshotgun",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 4 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Double Barrel Shotgun"] = {
                item = "weapon_dbshotgun",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Pistol Mk II"] = {
                item = "weapon_pistol_mk2",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 4 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["SNS Pistol Mk II"] = {
                item = "weapon_snspistol_mk2",
                count = 5,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 3 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["Ceramic Pistol"] = {
                item = "weapon_ceramicpistol",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 4 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 1 },
                },
            },

            ["AP Pistol"] = {
                item = "weapon_appistol",
                count = 4,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Heavy Revolver Mk II"] = {
                item = "weapon_revolver_mk2",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 6 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["Assault Rifle Mk II"] = {
                item = "weapon_assaultrifle_mk2",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 12 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Carbine Rifle Mk II"] = {
                item = "weapon_carbinerifle_mk2",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 13 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Special Carbine"] = {
                item = "weapon_specialcarbine",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 10 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Special Carbine Mk II"] = {
                item = "weapon_specialcarbine_mk2",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 12 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },

            ["Bullpup Rifle"] = {
                item = "weapon_bullpuprifle",
                count = 3,
                requiredItems = {
                    ['Weapon Parts'] = { item = 'weaponparts', amount = 9 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 4 },
                },
            },
        },

        Ammo = {
            --- Ox Inventory Default Bullets
            [".22 Long Rifle"] = {
                item = "ammo-22",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            [".38 LC"] = {
                item = "ammo-38",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            [".44 Magnum"] = {
                item = "ammo-44",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            [".45 ACP"] = {
                item = "ammo-45",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            [".50 AE"] = {
                item = "ammo-50",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["9mm"] = {
                item = "ammo-9",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["5.56x45"] = {
                item = "ammo-rifle",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["7.62x39"] = {
                item = "ammo-rifle2",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },

            ["12 Gauge"] = {
                item = "ammo-shotgun",
                count = 200,
                requiredItems = {
                    ['Brass Casing'] = { item = 'brasscasing', amount = 5 },
                    ['Gun Powder'] = { item = 'gunpowder', amount = 2 },
                },
            },
        },

        Attachments = {
            --- Kyro Weapon Pack V5 ---
            ["50 Round Drum"] = {
                item = "at_clip_drum_pistol",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["100 Round Mag"] = {
                item = "at_clip_100_pistol",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Clear Clip"] = {
                item = "at_clip_clear",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },
            --- End of Kyro Weapon Pack V5 ---

            --- Default GTAV Attachments; If you have Ox Inventory, this will work regardless.
            ["Tactical Flashlight"] = {
                item = "at_flashlight",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Suppressor"] = {
                item = "at_suppressor_light",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Grip"] = {
                item = "at_grip",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Extended Pistol Clip"] = {
                item = "at_clip_extended_pistol",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Extended Rifle Clip"] = {
                item = "at_clip_extended_rifle",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Rifle Drum"] = {
                item = "at_clip_drum_rifle",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Extended SMG Clip"] = {
                item = "at_clip_extended_smg",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Small Scope"] = {
                item = "at_scope_small",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Medium Scope"] = {
                item = "at_scope_medium",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },

            ["Large Scope"] = {
                item = "at_scope_large",
                count = 10,
                requiredItems = {
                    ['Polymer Filament'] = { item = 'polymerfilament', amount = 2 }
                }
            },
        },
    },

    Items = {
        Machinery = {
            ['CNC Machine'] = 'cncmachine',
            ['Bullet Press'] = 'bulletpress',
            ['3D Printer'] = '3dprinter',
            ['Generator'] = 'generator',
        },

        Materials = {
            ['Weapon Parts'] = 'weaponparts',
            ['Gun Powder'] = 'gunpowder',
            ['Brass Casings'] = 'brasscasing',
            ['Polymer Filament'] = 'polymerfilament',
            ['Generator Fuel'] = 'generatorfuel',
            ['Weapon Repair Kit'] = 'gunrepairkit',
        }
    },

    Models = {
        ['CNC Machine'] = 'leansy_spoody_gunplug_002',
        ['Bullet Press'] = 'prop_sewing_machine',
        ['3D Printer'] = 'leansy_spoody_gunplug_003',
        ['Generator'] = 'prop_generator_01a',
    },
}

RegisterNetEvent('spoodyGunPlug:config:notify', function(message, messageType)
    return Configuration.Notify(message, messageType)
end)

Locales = {
    ['NOTIFICATIONS'] = {
        ['GUNPLUG_PURCHASE_SUCCESSFUL'] = "You purchased %sx %s(s)!",
        ['GUNPLUG_PURCHASE_FAILED'] = "You don't have enough money for this purchase",
        ['GUNPLUG_REPAIR_SUCCESSFUL'] = "You've fully repaired the %s back to %s%%!",
        ['GUNPLUG_NO_ITEMS'] = "You don't have the required items for this product.",
        ['GUNPLUG_FEE_INSUFFICIENT'] = "You don't have enough money to cover the production fee.",
        ['GUNPLUG_NO_WEAPONS'] = "You don't have any weapons in your inventory!",
        ['GUNPLUG_FUEL_SUFFICIENT'] = "You can't refuel this generator; Fuel level already sufficient.",
        ['GUNPLUG_NO_ITEM_INTERACTION'] = "You don't have the required item for this interaction",
        ['GUNPLUG_REFUEL_SUCCESS'] = "You've fully refueled the generator!",
        ['GUNPLUG_NO_FUEL'] = "Cannot use machine; No fuel power",
        ['GUNPLUG_ITEM_PLACED'] = "You have already placed this item!",
        ['GUNPLUG_NO_GENERATOR'] = "You must have a generator running before placing this!",
        ['GUNPLUG_NO_ROLE'] = "You don't have the required job/role to access this shop",
    },

    ['CONTEXT_MENUS'] = {
        ['CONTEXT_MENUS_GENERATOR_FUEL_LEVEL'] = 'Fuel Level: %s%%',
        ['CONTEXT_MENUS_REFILL'] = 'Start Refueling',
        ['CONTEXT_MENUS_DESCRIPTION'] = 'Select to craft %sx %s',
        ['CONTEXT_MENUS_DESCRIPTION_REPAIR_1'] = "This weapon isn't damaged",
        ['CONTEXT_MENUS_DESCRIPTION_REPAIR_2'] = 'Select to repair this weapon *(1x Weapon Repair Kit Required)*',

        ['CONTEXT_MENUS_MANUFACTURE_TITLE'] = 'Manufacture Weapons',
        ['CONTEXT_MENUS_MANUFACTURE_DESCRIPTION'] = 'Select to start crafting weapons',

        ['CONTEXT_MENUS_REPAIR_TITLE'] = 'Repair Weapons',
        ['CONTEXT_MENUS_REPAIR_DESCRIPTION_1'] = 'Select to repair weapons',
        ['CONTEXT_MENUS_REPAIR_DESCRIPTION_2'] = 'Option unavailable',

        ['CONTEXT_MENUS_PURCHASE_DESCRIPTION'] = 'Select to purchase this product.',
        ['CONTEXT_MENUS_PRINT_DESCRIPTION'] = 'Select to 3D Print %sx %s',
    },

    ['PROGRESS_BAR'] = {
        ['PROGRESS_BAR_GENERAL_PREP_SURFACE'] = "Preparing Surface",
        ['PROGRESS_BAR_GENERAL_LOADING_M'] = "Loading Munitions",
        ['PROGRESS_BAR_3DPRINTER_LOAD'] = "Loading Machine",
        ['PROGRESS_BAR_3DPRINTER_START'] = "Starting 3D Printer",
        ['PROGRESS_BAR_3DPRINTER_WAIT'] = "Waiting for %s to print",
        ['PROGRESS_BAR_PICKUP'] = "Picking up machinery",
        ['PROGRESS_BAR_REFUEL'] = "Refueling Generator",
    },

    ['TEXT_UI'] = {
        ['TEXT_UI_PICKUP'] = '[F] Pickup Machinery',
        ['TEXT_UI_OPEN'] = "E - Open Shop",

        ['TARGET_OPEN_CNCMACHINE'] = 'Open CNC Machine',
        ['TARGET_OPEN_PRINTER'] = 'Open 3D Printer',
        ['TARGET_OPEN_BP'] = 'Open Bullet Press',
        ['TARGET_OPEN_GN'] = 'Open Generator',
        ['TARGET_OPEN_MACHINE_SHOP'] = "Open Machine Shop",
        ['TARGET_OPEN_MATERIALS_SHOP'] = "Open Materials Shop",
    },

    ['DIALOGS'] = {
        ['DIALOG_SHOP_PURCHASE'] = 'Would you like to purchase %sx %s for $%s?',
        ['DIALOG_SHOP_INPUT'] = 'How many %s would you like to purchase?',
        ['DIALOG_SHOP_CONFIRM_TITLE'] = 'Purchase %sx %s?',
        ['DIALOG_PRODUCTION_TITLE'] = "Produce %sx %s?",
        ['DIALOG_PRODUCTION_DESCRIPTION'] = "**Required Items**",
    },
}

Last updated