Newer
Older
TFC-BurgerShot / client / client.lua
local QBCore = exports['qb-core']:GetCoreObject()

-- Target Exports

exports['qb-target']:AddBoxZone("BurgerShotRecipie", Config.CookingLocation, 1.5, 1.6, {
    name = "BurgerShotRecipie", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zones
    debugPoly = false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
    minZ = Config.CookingLocation.z - 1, -- This is the bottom of the polyzone, this can be different from the Z value in the coords, this has to be a float value
    maxZ = Config.CookingLocation.z + 1, -- This is the top of the polyzone, this can be different from the Z value in the coords, this has to be a float value
  },{
    options = {
        {

            action = function()
                lib.showContext('bs_recipies')
            end,
            icon = "fas fa-burger",
            label = "Cook Food",
            job = Config.JobName,
        },
    },
    distance = 2.5
})

exports['qb-target']:AddBoxZone("BurgerShotShop", Config.ShopLocation, 1.5, 1.6, {
    name = "BurgerShotShop", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zones
    debugPoly = false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
    minZ = Config.ShopLocation.z - 1, -- This is the bottom of the polyzone, this can be different from the Z value in the coords, this has to be a float value
    maxZ = Config.ShopLocation.z + 1, -- This is the top of the polyzone, this can be different from the Z value in the coords, this has to be a float value
  },{
    options = {
        {
            action = function()
                lib.showContext('bs_shop')
            end,
            icon = "fas fa-shop",
            label = "Check Stock",
            job = Config.JobName,
        },
    },
    distance = 2.5
})

exports['qb-target']:AddBoxZone("BurgerShotStash", Config.StashLocation, 1.5, 1.6, {
    name = "BurgerShotStash", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zones
    debugPoly = false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
    minZ = Config.StashLocation.z - 1, -- This is the bottom of the polyzone, this can be different from the Z value in the coords, this has to be a float value
    maxZ = Config.StashLocation.z + 1, -- This is the top of the polyzone, this can be different from the Z value in the coords, this has to be a float value
  },{
    options = {
        {
            type = "client",
            event = "tfc-bs-job:client:openStash",
            icon = "fas fa-vault",
            label = "Check Fridge",
            job = Config.JobName,
        },
    },
    distance = 2.5
})
exports['qb-target']:AddBoxZone("BurgerShotDrink", Config.DrinkLocation, 1, 1, {
    name = "BurgerShotDrink", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zones
    debugPoly = false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
    minZ = Config.DrinkLocation.z - 1, -- This is the bottom of the polyzone, this can be different from the Z value in the coords, this has to be a float value
    maxZ = Config.DrinkLocation.z + 1, -- This is the top of the polyzone, this can be different from the Z value in the coords, this has to be a float value
  },{
    options = {
        {
            action = function()
                lib.showContext('bs_drinks')
            end,
            icon = "fas fa-shop",
            label = "Get Drink",
            job = Config.JobName,
        },
    },
    distance = 2.5
})
RegisterNetEvent('tfc-bs-job:client:openStash', function()
    local PlayerData = QBCore.Functions.GetPlayerData()

    if PlayerData.job.name == Config.JobName then
        TriggerServerEvent("ps-inventory:server:OpenInventory", "stash", "BurgerShotStash", {maxweight = 40000, slots = 100})
        TriggerEvent("ps-inventory:client:SetCurrentStash", "BurgerShotStash")
    else
        QBCore.Functions.Notify('You dont work here!', 'error')
    end
end)