Jota Dev Jobs Crafting System

Here you can find documentation on how to install our shop's crafting and consumables system.

How to start the script for its correct operation:

Put in your server.cfg

# JotaDev Crafting System
ensure jc_craft_shops

Insert SQL into your database and configure your framework:

CREATE TABLE IF NOT EXISTS `job_levels` (
  `job` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` int(11) DEFAULT 1,
  `level_progress` float DEFAULT 0,
  PRIMARY KEY (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Import Items according to your framework

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
	('aceite', 'Aceite', 1, 0, 1),
	('agua', 'Agua', 1, 0, 1),
	('alioli', 'Alioli', 1, 0, 1),
	('atun', 'Atun', 1, 0, 1),
	('bacon', 'Bacon', 1, 0, 1),
	('barra_chocolate', 'Barra de Chocolate', 1, 0, 1),
	('batido_fresa', 'Batido de Fresa', 1, 0, 1),
	('batido_fresa_crafted', 'Batido de Fresa', 1, 0, 1),
	('bocata', 'Bocadillo Mixto', 1, 0, 1),
	('bocata_atun', 'Bocadillo de Atun', 1, 0, 1),
	('bocata_bacon_queso', 'Bocadillo Bacon y Queso', 1, 0, 1),
	('bocata_chorizo', 'Bocadillo de Chorizo', 1, 0, 1),
	('bocata_jamon', 'Bocadillo Jamon Serrano', 1, 0, 1),
	('bocata_lomo_queso', 'Bocadillo Lomo y Queso', 1, 0, 1),
	('bocata_pollo', 'Bocadillo de Pollo', 1, 0, 1),
	('botella_plastico', 'Botella de Plastico Vacia', 1, 0, 1),
	('botella_vino', 'Botella de Vino', 1, 0, 1),
	('brum_jardrink_lime', 'Granizado de Limon', 1, 0, 1),
	('brum_jardrink_orange', 'Granizada de Naranja', 1, 0, 1),
	('brum_jardrink_red', 'Granizada de Fresa', 1, 0, 1),
	('carne_picada', 'Carne Picada', 1, 0, 1),
	('cereales', 'Cereales', 1, 0, 1),
	('cerveza', 'Cerveza', 1, 0, 1),
	('chorizo', 'Chorizo', 1, 0, 1),
	('cocacola', 'Coca Cola', 1, 0, 1),
	('copa_de_vino', 'Copa de vino', 1, 0, 1),
	('copa_vacia', 'Copa de Vino Vacia', 1, 0, 1),
	('curacao_azul', 'Curaçao Azul', 1, 0, 1),
	('ensalada', 'Ensalada', 1, 0, 1),
	('fanta_limon', 'Fanta de Limon', 1, 0, 1),
	('fanta_naranja', 'Fanta de Naranja', 1, 0, 1),
	('filete_lomo', 'Filete de Lomo', 1, 0, 1),
	('filete_pollo', 'Filete de Pollo', 1, 0, 1),
	('fresa', 'Fresa', 1, 0, 1),
	('gofre', 'Gofre', 1, 0, 1),
	('hielo', 'Hielo', 1, 0, 1),
	('hierbabuena', 'Hierba Buena', 1, 0, 1),
	('hotdog', 'Perrito Caliente', 1, 0, 1),
	('jamon', 'Jamon Serrano', 1, 0, 1),
	('jugo_lima_fresco', 'Jugo de Lima Fresco', 1, 0, 1),
	('ketchup', 'Ketchup', 1, 0, 1),
	('leche', 'Leche', 1, 0, 1),
	('lechuga', 'Lechuga', 1, 0, 1),
	('limon', 'Limon', 1, 0, 1),
	('margarita', 'Margarita de Limon', 1, 0, 1),
	('margaritas_coconut', 'Margarita de Coco', 1, 0, 1),
	('margaritas_grapefruit', 'Margarita de Pomelo', 1, 0, 1),
	('margaritas_oceanbreeze', 'Margarita Ocean Breeze', 1, 0, 1),
	('margaritas_orange', 'Margarita de Naranja', 1, 0, 1),
	('margaritas_pineapple', 'Margarita de Piña', 1, 0, 1),
	('margaritas_strawberry', 'Margarita de Fresa', 1, 0, 1),
	('mayonesa', 'Mayonesa', 1, 0, 1),
	('mojito', 'Mojito', 1, 0, 1),
	('mov_advanced_ceramic', 'Premium Ceramic', 10, 0, 1),
	('mov_advanced_wax', 'Advanced Wax', 10, 0, 1),
	('mov_basic_ceramic', 'Basic Ceramic', 10, 0, 1),
	('mov_basic_wax', 'Basic Wax', 10, 0, 1),
	('naranja', 'Naranja', 1, 0, 1),
	('oblead_taco', 'Oblea de Taco', 1, 0, 1),
	('pan', 'Pan', 1, 0, 1),
	('pan_molde', 'Pan de Molde', 1, 0, 1),
	('pan_perrito', 'Pan Perrito Caliente', 1, 0, 1),
	('patata_frita', 'Patatas Fritas', 1, 0, 1),
	('patatas_bolsa', 'Patatas Fritas', 1, 0, 1),
	('pimiento', 'Pimiento', 1, 0, 1),
	('pizza', 'Porcion de Pizza', 1, 0, 1),
	('queso', 'Queso', 1, 0, 1),
	('rodaja_naranja', 'Rodaja de Naranja', 1, 0, 1),
	('rodaja_pomelo', 'Rodaja de Pomelo', 1, 0, 1),
	('salchicha', 'Salchicha', 1, 0, 1),
	('sanwich_crafted', 'Sanwitch', 1, 0, 1),
	('sprite', 'Sprite', 1, 0, 1),
	('taco', 'Taco', 1, 0, 1),
	('tequila', 'Tequila', 1, 0, 1),
	('tomate', 'Tomate', 1, 0, 1),
	('vaso', 'Vaso de Coctel', 1, 0, 1),
	('vaso_granizado', 'Vaso de Granizado', 1, 0, 1),
	('york', 'Jamon de York', 1, 0, 1),
	('zumo_coco', 'Zumo de Coco', 1, 0, 1),
	('zumo_limon', 'Zumo de Limon', 1, 0, 1),
	('zumo_naranja', 'Zumo de Naranja', 1, 0, 1),
	('zumo_pina', 'Zumo de Piña', 1, 0, 1),
	('zumo_pomelo', 'Zumo de Pomelo', 1, 0, 1);

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;

Put the work management company you use

Compatible with jobs_creator, origen_ masterjob, qb-management, esx_society and any customizable society

Config.SocietyOption = '' -- esx_society | origen_masterjob | jobs_creator | qb-management | custom_society (Editable/Server/SEditable.lua)

If you are using a custom society, go to jc_craft_shops/Editable/Server/SEditable.lua and edit it to your liking

function TrySocietyPayment(jobName, totalAmount, item, ammount, src)
    local xPlayer
    if Config.Framework == "esx" then
        xPlayer = ESX.GetPlayerFromId(src)
    elseif Config.Framework == "qb" then
        xPlayer = QBCore.Functions.GetPlayer(src)
    end

    if Config.SocietyOption == 'esx_society' then 
        local societyName = "society_" .. jobName

        TriggerEvent('esx_addonaccount:getSharedAccount', societyName, function(account)
            if account and account.money >= totalAmount then
                account.removeMoney(totalAmount)
                xPlayer.addInventoryItem(item, amount)
                TriggerClientEvent('esx:showNotification', src, "La sociedad pagó por " .. amount .. "x " .. item)
            else
                TriggerClientEvent('esx:showNotification', src, "La sociedad no tiene suficiente dinero.")
            end
        end)
    elseif Config.SocietyOption == 'origen_masterjob' then 
        local businessId = exports['origen_masterjob']:GetBusiness(jobName)

        if businessId then
            local currentMoney = exports['origen_masterjob']:GetBusinessMoney(businessId)

            if currentMoney >= totalAmount then
                exports['origen_masterjob']:RemoveBusinessMoney(businessId, totalAmount)

                if xPlayer then
                    if Config.Framework == "esx" then
                        xPlayer.addInventoryItem(item, amount)
                        TriggerClientEvent('esx:showNotification', src, "La sociedad pagó por " .. amount .. "x " .. item)
                    elseif Config.Framework == "qb" then
                        xPlayer.Functions.AddItem(item, amount)
                        TriggerClientEvent('QBCore:Notify', src, "La sociedad pagó por " .. amount .. "x " .. item, "success")
                    end
                end
            else
                if Config.Framework == "esx" then
                    TriggerClientEvent('esx:showNotification', src, "La sociedad no tiene suficiente dinero.")
                elseif Config.Framework == "qb" then
                    TriggerClientEvent('QBCore:Notify', src, "La sociedad no tiene suficiente dinero.", "error")
                end
            end
        else
            if Config.Framework == "esx" then
                TriggerClientEvent('esx:showNotification', src, "No se encontró la empresa asociada.")
            elseif Config.Framework == "qb" then
                TriggerClientEvent('QBCore:Notify', src, "No se encontró la empresa asociada.", "error")
            end
        end
    elseif Config.Framework == "qb" and Config.SocietySystem == "qb-management" then
        local account = exports['qb-management']:GetAccount(jobName)
        if account and account.balance and account.balance >= totalAmount then
            exports['qb-management']:RemoveMoney(jobName, totalAmount)
            xPlayer.Functions.AddItem(item, amount)
            TriggerClientEvent('QBCore:Notify', src, "La sociedad pagó por " .. amount .. "x " .. item, "success")
        else
            TriggerClientEvent('QBCore:Notify', src, "La sociedad no tiene suficiente dinero.", "error")
        end

    elseif Config.SocietyOption == 'jobs_creator' then 
        local balance = exports['jobs_creator']:getJobAccountMoney(jobName)

        if balance and balance >= totalAmount then
            exports['jobs_creator']:removeSocietyMoney(jobName, totalAmount)

            if xPlayer then
                if Config.Framework == "esx" then
                    xPlayer.addInventoryItem(item, amount)
                    TriggerClientEvent('esx:showNotification', src, "La sociedad pagó por " .. amount .. "x " .. item)
                elseif Config.Framework == "qb" then
                    xPlayer.Functions.AddItem(item, amount)
                    TriggerClientEvent('QBCore:Notify', src, "La sociedad pagó por " .. amount .. "x " .. item, "success")
                end
            end
        else
            if Config.Framework == "esx" then
                TriggerClientEvent('esx:showNotification', src, "La sociedad no tiene suficiente dinero.")
            elseif Config.Framework == "qb" then
                TriggerClientEvent('QBCore:Notify', src, "La sociedad no tiene suficiente dinero.", "error")
            end
        end
    elseif Config.SocietyOption == 'custom_society' then 
        print '[jc_core] aqui tu sociedad'
    end

end

Import All images from jc_craft_shops/html/images/, import them all in to your inventory, whatever than inventory is. Compatible with any inventory

Last updated