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-StoreRobbery

We can integrate this system into QB-StoreRobbery quite easily allowing you to gain Turf points by robbing grocery stores.

We want to head to this directory qb-storerobbery/server/main.lua

Lets now fine the function that starts with

RegisterNetEvent('qb-storerobbery:server:takeMoney', function(register, isDone)

Lets now go to line 47 where it issues the user dirty money.

exports['qb-inventory']:AddItem(src, 'markedbills', bags, false, info, 'qb-storerobbery:server:takeMoney')
TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['markedbills'], 'add')

Right underneath this lets add in, this will add in 5 points for the user robbing

exports["Haptic-Gangs"]:modifypoints(src, "add", 5)

Your code should now look like this.

RegisterNetEvent('qb-storerobbery:server:takeMoney', function(register, isDone)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end
    local playerPed = GetPlayerPed(src)
    local playerCoords = GetEntityCoords(playerPed)
    if #(playerCoords - Config.Registers[register][1].xyz) > 3.0 or (not Config.Registers[register].robbed and not isDone) or (Config.Registers[register].time <= 0 and not isDone) then
        return DropPlayer(src, 'Attempted exploit abuse')
    end
    if isDone then
        local bags = math.random(1, 3)
        local info = {
            worth = math.random(cashA, cashB)
        }
        exports['qb-inventory']:AddItem(src, 'markedbills', bags, false, info, 'qb-storerobbery:server:takeMoney')
        TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['markedbills'], 'add')
        --Inserted Here
        exports["Haptic-Gangs"]:modifypoints(src, "add", 5)
        --
        if math.random(1, 100) <= Config.stickyNoteChance then
            local code = SafeCodes[Config.Registers[register].safeKey]
            if Config.Safes[Config.Registers[register].safeKey].type == 'keypad' then
                info = {
                    label = Lang:t('text.safe_code') .. tostring(code)
                }
            else
                local label = Lang:t('text.safe_code') .. ' '

                for i = 1, #code do
                    label = label .. tostring(math.floor((code[i] % 360) / 3.60)) .. ' - '
                end

                info = { label = label:sub(1, -3) }
            end
            exports['qb-inventory']:AddItem(src, 'stickynote', 1, false, info, 'qb-storerobbery:server:takeMoney')
            TriggerClientEvent('qb-inventory:client:ItemBox', src, QBCore.Shared.Items['stickynote'], 'add')
        end
    end
end)
Previous๐Ÿ’Ž QB-JewelleryNext๐Ÿ’ฆRcore Integration

Last updated 5 months ago