Pug Development
  • ๐Ÿ‘‹Welcome To Pug Development
    • ๐Ÿ“ŒInformation
  • ๐Ÿ““Scripts
    • ๐Ÿ’ŽRobbery Creator
      • ๐Ÿ“Installation
        • Inventory Items
          • QB items
          • Ox Items
        • Mini Games
      • ๐Ÿ’กThings to know
        • ๐ŸŽจHow To Use
        • ๐ŸŽฎCustom Mini Games
        • ๐Ÿ’ฃCreate Explosion
        • ๐Ÿ“‘Tab Settings
        • ๐Ÿ“ฃBank Truck & ATM Alert
        • ๐Ÿ“ฑCustom Keypad
        • ๐Ÿ’ฑMove Steps Around
        • ๐Ÿ‘ปMake Props Disappear When Looted
        • ๐ŸคนRemove Kill Screen Effect
        • ๐ŸŽPreset Heist Progression
      • ๐Ÿ“œDependency & Support
    • ๐Ÿ’ผBusiness Creator
      • ๐Ÿ“Installation
      • ๐Ÿ’กThings to know
        • ๐Ÿ”—Linking Jobs To The Menu
        • ๐Ÿ“ƒOpen Menu
        • ๐Ÿ”›Criminal crafting
        • ๐Ÿ›ฐ๏ธCreated Items
      • โ“FAQ
      • ๐Ÿ“œDependency & Support
    • ๐Ÿ”ซPaint Ball
      • ๐Ÿ“Installation
        • ๐Ÿ‚ox_inventory
        • ๐ŸฆฅDispatch/Shots Fired
        • โŒqb-anticheat
      • ๐Ÿ“œDependency & Support
      • ๐Ÿ’กThings to know
        • ๐Ÿ—บ๏ธMap Making Tutorial
        • ๐Ÿ‘šSet Team Outfits
        • ๐Ÿ“…Scoreboard
        • ๐Ÿ”Surrender
    • ๐Ÿ› ๏ธRepo Job
      • ๐Ÿ“Installation
      • ๐Ÿ“œDependency & Support
    • ๐Ÿ’‰Coke Business
      • ๐Ÿ“Installation
      • ๐Ÿ“œDependency & Support
    • ๐ŸŽฃFishing
      • ๐Ÿ“Installation
        • Inventory Items
          • QB items
          • Ox Items
        • ๐ŸŸFishing Lure
      • ๐Ÿ“œDependency & Support
      • ๐Ÿ’กThings to know
        • โ†—๏ธProgression
        • ๐Ÿ’ฏReputation
    • ๐Ÿ”ซWeapon Sling
      • ๐Ÿ“Installation
      • ๐Ÿ“œDependency & Support
    • ๐Ÿ†Battle Royale
      • ๐Ÿ“Installation
        • Inventory Items
          • QB items
          • Ox Items
        • โ˜๏ธWeather Sync
        • ๐Ÿ‚ox_inventory
        • ๐ŸฆฅDispatch/Shots Fired
        • โŒqb-anticheat
      • ๐Ÿ“œDependency & Support
    • ๐Ÿš˜Car Chopping
      • ๐Ÿ“Installation
        • Inventory Items
          • QB items
          • Ox Items
      • ๐Ÿ“œDependency & Support
Powered by GitBook
On this page
  1. Scripts
  2. Paint Ball
  3. Installation

Dispatch/Shots Fired

Dispatch Script Adjustment In your dispatch script, search for "shot" or "shooting" and add the following if statement to remove shots fired calls when players are in a paintball match:

if exports["pug-paintball"]:IsInPaintball() then return end

Example for ps-dispatch/client/eventhandlers.lua:

AddEventHandler('CEventGunShot', function(witnesses, ped)
    if exports["pug-paintball"]:IsInPaintball() then return end
    if IsPedCurrentWeaponSilenced(cache.ped) then return end
    if inNoDispatchZone then return end
    if BlacklistedWeapon(cache.ped) then return end
        
    WaitTimer('Shooting', function()
        if cache.ped ~= ped then return end

        if PlayerData.job.type == 'leo' then
            if not Config.Debug then
                return
            end
        end

        if inHuntingZone then
            exports['ps-dispatch']:Hunting()
            return
        end

        if witnesses and not isPedAWitness(witnesses, ped) then return end

        if cache.vehicle then
            exports['ps-dispatch']:VehicleShooting()
        else
            exports['ps-dispatch']:Shooting()
        end
    end)
end)

CD_DISPATCH REPLACEMENT

Replace this portion in cd_dispatch/client/policealerts.lua to remove shots fired calls if you are using cd_dispatch

if Config.PoliceAlerts.GunShots.ENABLE then
    CreateThread(function()
        while not Authorised do Wait(1000) end
        while true do
            wait = 500
            local ped = PlayerPedId()
            local has_weapon, weapon_hash = GetCurrentPedWeapon(ped)
            if has_weapon then wait = 5 end
            if IsPedShooting(ped) and not IsPedCurrentWeaponSilenced(ped) then
                if not Config.PoliceAlerts.GunShots.WhitelistedWeapons[weapon_hash] then
                    if not IsPlayerJobWhitelisted() and not IsPlayerInGunshotWhitelistZone() and IsWitnessPedInArea() then
                        if not exports["pug-paintball"]:IsInPaintball() then
                            local weapon_name = Config.PoliceAlerts.GunShots.WeaponLabels[weapon_hash]
                            if weapon_name == nil then weapon_name = L('firearm') end

                            local in_vehicle = IsPedInAnyVehicle(ped, true)
                            local data = GetPlayerInfo()
                            local message
                            if in_vehicle then
                                message = L('policealerts_gunshots_message_1', data.vehicle_colour, data.vehicle_label, data.vehicle_plate, data.heading, data.street)
                            else
                                message = L('policealerts_gunshots_message_2', data.sex, weapon_name, data.street)
                            end
                            TriggerServerEvent('cd_dispatch:AddNotification', {
                                job_table = Config.PoliceAlerts.police_jobs, 
                                coords = data.coords,
                                title = L('policealerts_gunshots_title'),
                                message = message, 
                                flash = 0,
                                unique_id = data.unique_id,
                                sound = 1,
                                blip = {
                                    sprite = 313, 
                                    scale = 1.2, 
                                    colour = 3,
                                    flashes = false, 
                                    text = L('policealerts_gunshots_title'),
                                    time = 5,
                                    radius = 100,
                                }
                            })
                            if Config.PoliceAlerts.add_bolos and in_vehicle then
                                TriggerServerEvent('cd_dispatch:pdalerts:Gunshots', data)
                            end
                        end
                        Wait(Config.PoliceAlerts.cooldown*1000)
                    end
                end
            end
            Wait(wait)
        end
    end)
end
Previousox_inventoryNextqb-anticheat

Last updated 4 months ago

๐Ÿ““
๐Ÿ”ซ
๐Ÿ“
๐Ÿฆฅ