LC-Development
  • πŸ‘‹Welcome to HapticCode
  • πŸ“šLibrary
    • πŸ–₯️Haptic-Lib
      • πŸ”§ Config
      • πŸ“™ Usage
      • 🀝Client Functions
        • Blips
        • Items
        • Notify
        • Target
        • Peds
      • πŸ’»Server Functions
        • Items
        • Jobs
        • Money Functions
        • Notify
  • πŸ˜‡Remastered Scripts
    • πŸ›’ LC-Businesses
      • 🎯Job Blips
      • πŸ’Ό Duty Locations
      • ❄️ Fridges
        • Fridge Shops
        • Fridge Stashs
        • Final Step
      • πŸ“₯ Trays
      • πŸ” Drink/Fryer/Grill/Pack
      • πŸ“¦Shared Employee Stash
      • πŸ“¦Private Employee Stash
      • πŸ“¦Table Stashs
      • πŸͺ‘ Chairs
      • πŸ’ƒ NPC Dancers/Strippers
      • 🎧 DJ Booths
      • πŸ’°Cash Registers
      • πŸ§‘Custom Animations
      • πŸ”Consumables
    • πŸ›οΈLC-Cityhall
      • πŸ“Config
      • πŸ’³Licenses
  • Haptic
    • 😷 Haptic-Gangs
      • πŸ”§ Initial Config
      • πŸ“š Zone Configuration
      • πŸ’ŠDrug Dealing
        • πŸ’Š Zone Based Dealing
      • πŸ’€Death Tracker
      • πŸ’»Exports
      • πŸ“ Integrations
        • πŸš‘ QB-AmbulanceJob
        • πŸ’Ž QB-Jewellery
        • πŸ’΅ QB-StoreRobbery
        • πŸ’¦Rcore Integration
      • πŸ—οΈCommon Issues
    • πŸ”«Haptic-Ammunation
      • πŸ“Config
    • πŸ’ŠHaptic-DrugEffects
Powered by GitBook
On this page
  1. Haptic
  2. 😷 Haptic-Gangs
  3. πŸ“ Integrations

πŸ’Ž QB-Jewellery

We can easily integrate this into QB-Jewellery by adding in two things.

Head to qb-jewelery/clients/main.lua

Around line 36 we have the smashVirtine function.

local function smashVitrine(k)
    if not firstAlarm then
        exports['ps-dispatch']:VangelicoRobbery(camId)
        firstAlarm = true
    end

Under our police alert lets add in a new line

TriggerServerEvent("qb-jewellery:server:gainXP", 5)

It should now look like this

local function smashVitrine(k)
    if not firstAlarm then
        exports['ps-dispatch']:VangelicoRobbery(camId)
        TriggerServerEvent("qb-jewellery:server:gainXP", 5)
        firstAlarm = true
    end

    QBCore.Functions.TriggerCallback('qb-jewellery:server:getCops', function(cops)
        if cops >= Config.RequiredCops then
            local animDict = 'missheist_jewel'
            local animName = 'smash_case'
            local ped = PlayerPedId()
            local plyCoords = GetOffsetFromEntityInWorldCoords(ped, 0, 0.6, 0)
            local pedWeapon = GetSelectedPedWeapon(ped)
            if math.random(1, 100) <= 80 and not QBCore.Functions.IsWearingGloves() then
                TriggerServerEvent('evidence:server:CreateFingerDrop', plyCoords)
            elseif math.random(1, 100) <= 5 and QBCore.Functions.IsWearingGloves() then
                TriggerServerEvent('evidence:server:CreateFingerDrop', plyCoords)
                QBCore.Functions.Notify(Lang:t('error.fingerprints'), 'error')
            end
            smashing = true
            QBCore.Functions.Progressbar('smash_vitrine', Lang:t('info.progressbar'), Config.WhitelistedWeapons[pedWeapon]['timeOut'], false, true, {
                disableMovement = true,
                disableCarMovement = true,
                disableMouse = false,
                disableCombat = true,
            }, {}, {}, {}, function() -- Done
                TriggerServerEvent('qb-jewellery:server:vitrineReward', k)
                TriggerServerEvent('qb-jewellery:server:setTimeout')
                --TriggerServerEvent('police:server:policeAlert', 'Robbery in progress')
                smashing = false
                TaskPlayAnim(ped, animDict, 'exit', 3.0, 3.0, -1, 2, 0, 0, 0, 0)
            end, function() -- Cancel
                TriggerServerEvent('qb-jewellery:server:setVitrineState', 'isBusy', false, k)
                smashing = false
                TaskPlayAnim(ped, animDict, 'exit', 3.0, 3.0, -1, 2, 0, 0, 0, 0)
            end)
            TriggerServerEvent('qb-jewellery:server:setVitrineState', 'isBusy', true, k)

            CreateThread(function()
                while smashing do
                    loadAnimDict(animDict)
                    TaskPlayAnim(ped, animDict, animName, 3.0, 3.0, -1, 2, 0, 0, 0, 0)
                    Wait(500)
                    TriggerServerEvent('InteractSound_SV:PlayOnSource', 'breaking_vitrine_glass', 0.25)
                    loadParticle()
                    StartParticleFxLoopedAtCoord('scr_jewel_cab_smash', plyCoords.x, plyCoords.y, plyCoords.z, 0.0, 0.0, 0.0, 1.0, false, false, false, false)
                    Wait(2500)
                end
            end)
        else
            QBCore.Functions.Notify(Lang:t('error.minimum_police', { value = Config.RequiredCops }), 'error')
        end
    end)
end

Now we need to modify the server sided file.

Scroll all the way to the bottom and add this.

RegisterNetEvent('qb-jewellery:server:gainXP', function(amount)
    local src = source
    exports["Haptic-Gangs"]:modifypoints(src, "add", amount)
end)

Congratulations, your players will now gain XP for robbing a vangelico

PreviousπŸš‘ QB-AmbulanceJobNextπŸ’΅ QB-StoreRobbery

Last updated 5 months ago