diff --git a/server-data/resources/[esx_addons]/ps-dispatch/client/cl_commands.lua b/server-data/resources/[esx_addons]/ps-dispatch/client/cl_commands.lua index 40b35c31..380f2871 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/client/cl_commands.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/client/cl_commands.lua @@ -1,15 +1,12 @@ - local playAnim = false local phoneProp = 0 local phoneModel = Config.PhoneModel - -- Item checks to return whether or not the client has a phone or not local function HasPhone() return Functions[Config.Core].HasPhone() end - -- Loads the animdict so we can execute it on the ped local function loadAnimDict(dict) RequestAnimDict(dict) diff --git a/server-data/resources/[esx_addons]/ps-dispatch/config.lua b/server-data/resources/[esx_addons]/ps-dispatch/config.lua index d820c42e..43dbfecf 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/config.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/config.lua @@ -9,12 +9,12 @@ Config.Cooldown311 = 60 Config.Enable = {} Config.Timer = {} -Config.PoliceJob = { "police", "bcso"} +Config.PoliceJob = { "police"} -- Enable if you only want to send alerts to onDuty officers Config.OnDutyOnly = true -Config.PoliceAndAmbulance = { "police", "ambulance", "bcso"} +Config.PoliceAndAmbulance = { "police", "ambulance"} Config.PhoneModel = 'patoche_props_phone1' -- sets report chance to 100% diff --git a/server-data/resources/[esx_addons]/ps-dispatch/fxmanifest.lua b/server-data/resources/[esx_addons]/ps-dispatch/fxmanifest.lua index 1d0f9b3b..4d5c599a 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/fxmanifest.lua @@ -1,33 +1,26 @@ -fx_version 'cerulean' -game 'gta5' +fx_version("cerulean") +game("gta5") -version '0.0' -description 'https://github.com/Project-Sloth/ps-dispatch' +version("1.0.2") +description("https://github.com/Project-Sloth/ps-dispatch") -shared_scripts { - 'config.lua', - 'locales/locales.lua', -} +shared_scripts({ + "config.lua", + "locales/locales.lua", +}) -client_scripts{ - 'client/cl_core.lua', - 'client/cl_main.lua', - 'client/cl_events.lua', - 'client/cl_eventhandlers.lua', - 'client/cl_extraalerts.lua', - 'client/cl_commands.lua', - 'client/cl_loops.lua', -} -server_script { - 'server/sv_core.lua', - 'server/sv_dispatchcodes.lua', - 'server/sv_main.lua' -} +client_scripts({ + "client/*.lua", +}) -ui_page 'ui/index.html' +server_script({ + "server/*.lua", +}) -files { - 'ui/index.html', - 'ui/app.js', - 'ui/style.css', -} +ui_page("ui/index.html") + +files({ + "ui/index.html", + "ui/app.js", + "ui/style.css", +}) diff --git a/server-data/resources/[esx_addons]/ps-dispatch/locales/locales.lua b/server-data/resources/[esx_addons]/ps-dispatch/locales/locales.lua index 0297e82d..b7dce8a9 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/locales/locales.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/locales/locales.lua @@ -1,236 +1,235 @@ Locales = { - - ['en'] = { - ['unknown_caller'] = "Unknown caller", - ['caller_unknown'] = "Unknown", - ['caller_local'] = "Local", - ['call_from'] = "Call from ", - ['two_door'] = "Two-door ", - ['three_door'] = "Three-door ", - ['four_door'] = "Four-door ", - ['compact'] = "Compact", - ['sedan'] = "Sedan", - ['suv'] = "SUV", - ['coupe'] = "Coupe", - ['muscle'] = "Muscle car", - ['sports_classic'] = "Sports classic", - ['sports'] = "Sports car", - ['super'] = "Super car", - ['motorcycle'] = "Motorcycle", - ['offroad'] = "Off-road vehicle", - ['industrial'] = "Industrial vehicle", - ['utility'] = "Utility vehicle", - ['van'] = "Van", - ['service'] = "Service vehicle", - ['military'] = "Military vehicle", - ['truck'] = "Truck", + ["en"] = { + ["unknown_caller"] = "Unknown caller", + ["caller_unknown"] = "Unknown", + ["caller_local"] = "Local", + ["call_from"] = "Call from ", + ["two_door"] = "Two-door ", + ["three_door"] = "Three-door ", + ["four_door"] = "Four-door ", + ["compact"] = "Compact", + ["sedan"] = "Sedan", + ["suv"] = "SUV", + ["coupe"] = "Coupe", + ["muscle"] = "Muscle car", + ["sports_classic"] = "Sports classic", + ["sports"] = "Sports car", + ["super"] = "Super car", + ["motorcycle"] = "Motorcycle", + ["offroad"] = "Off-road vehicle", + ["industrial"] = "Industrial vehicle", + ["utility"] = "Utility vehicle", + ["van"] = "Van", + ["service"] = "Service vehicle", + ["military"] = "Military vehicle", + ["truck"] = "Truck", -- DISPATCH MESSAGES - ['vehicleshots'] = "Shots Fired from Vehicle", - ['shooting'] = "Discharge of a firearm", - ['melee'] = "Fight in progress", - ['driveby'] = "Drive-by shooting", - ['speeding'] = "Reckless driving", - ['autotheft'] = "Theft of a motor vehicle", - ['persondown'] = "Person is injured", - ['storerobbery'] = "Store Robbery", - ['fleecabank'] = "Fleeca Bank Robbery", - ['paletobank'] = "Paleto Bank Robbery", - ['pacificbank'] = "Pacific Bank Robbery", - ['prisonbreak'] = "Prison Break In Progress", - ['vangelico'] = "Vangelico Robbery", - ['houserobbery'] = "House Robbery", - ['drugsell'] = "Suspicious Handoff", - ['carjacking'] = "Car Jacking", - ['vehicletheft'] = "Vehicle Theft", - ['officerdown'] = "Officer is down", - ['emsdown'] = "EMS Down", - ['artgalleryrobbery'] = "Art Gallery Robbery", - ['humanerobbery'] = "Humane Labs Robbery", - ['trainrobbery'] = "Train Robbery", - ['vanrobbery'] = "Security Van Robbery", - ['underground'] = "Bunker Robbery", - ['drugboatrobbery'] = "Suspicious Boat", - ['unionrobbery'] = "Union Depository Robbery", - ['carboosting'] = "Car Boosting In Progress", - ['yachtheist'] = "Yacht Heist In Progress", - ['susactivity'] = "Suspicious Activity", + ["vehicleshots"] = "Shots Fired from Vehicle", + ["shooting"] = "Discharge of a firearm", + ["melee"] = "Fight in progress", + ["driveby"] = "Drive-by shooting", + ["speeding"] = "Reckless driving", + ["autotheft"] = "Theft of a motor vehicle", + ["persondown"] = "Person is injured", + ["storerobbery"] = "Store Robbery", + ["fleecabank"] = "Fleeca Bank Robbery", + ["paletobank"] = "Paleto Bank Robbery", + ["pacificbank"] = "Pacific Bank Robbery", + ["prisonbreak"] = "Prison Break In Progress", + ["vangelico"] = "Vangelico Robbery", + ["houserobbery"] = "House Robbery", + ["drugsell"] = "Suspicious Handoff", + ["carjacking"] = "Car Jacking", + ["vehicletheft"] = "Vehicle Theft", + ["officerdown"] = "Officer is down", + ["emsdown"] = "EMS Down", + ["artgalleryrobbery"] = "Art Gallery Robbery", + ["humanerobbery"] = "Humane Labs Robbery", + ["trainrobbery"] = "Train Robbery", + ["vanrobbery"] = "Security Van Robbery", + ["underground"] = "Bunker Robbery", + ["drugboatrobbery"] = "Suspicious Boat", + ["unionrobbery"] = "Union Depository Robbery", + ["carboosting"] = "Car Boosting In Progress", + ["yachtheist"] = "Yacht Heist In Progress", + ["susactivity"] = "Suspicious Activity", }, - ['fr'] = { - ['unknown_caller'] = "Appelant inconnu", - ['caller_unknown'] = "Inconnu", - ['caller_local'] = "Local", - ['call_from'] = "Appel de ", - ['two_door'] = "Deux portes ", - ['three_door'] = "Trois portes ", - ['four_door'] = "Quatre portes ", - ['compact'] = "Compact", - ['sedan'] = "Sedan", - ['suv'] = "SUV", - ['coupe'] = "Coupé", - ['muscle'] = "Voiture de muscle", - ['sports_classic'] = "Sports classique", - ['sports'] = "Voiture de sport", - ['super'] = "Super voiture", - ['motorcycle'] = "Motocycle", - ['offroad'] = "Véhicule tout terrain", - ['industrial'] = "Véhicule industriel", - ['utility'] = "Véhicule utilitaire", - ['van'] = "Van", - ['service'] = "Véhicule de service", - ['military'] = "Véhicule militaire", - ['truck'] = "un camion", - ['melee'] = "Combat en cours", - ['shooting'] = "Décharge d'une arme à feu", - ['driveby'] = "Prise de vue au volant", - ['speeding'] = "Conduite dangereuse", - ['autotheft'] = "Vol d'un véhicule à moteur", - ['officerdown'] = "Officier est à terre", - ['persondown'] = "Personne est blessée", + ["fr"] = { + ["unknown_caller"] = "Appelant inconnu", + ["caller_unknown"] = "Inconnu", + ["caller_local"] = "Local", + ["call_from"] = "Appel de ", + ["two_door"] = "Deux portes ", + ["three_door"] = "Trois portes ", + ["four_door"] = "Quatre portes ", + ["compact"] = "Compact", + ["sedan"] = "Sedan", + ["suv"] = "SUV", + ["coupe"] = "Coupé", + ["muscle"] = "Voiture de muscle", + ["sports_classic"] = "Sports classique", + ["sports"] = "Voiture de sport", + ["super"] = "Super voiture", + ["motorcycle"] = "Motocycle", + ["offroad"] = "Véhicule tout terrain", + ["industrial"] = "Véhicule industriel", + ["utility"] = "Véhicule utilitaire", + ["van"] = "Van", + ["service"] = "Véhicule de service", + ["military"] = "Véhicule militaire", + ["truck"] = "un camion", + ["melee"] = "Combat en cours", + ["shooting"] = "Décharge d'une arme à feu", + ["driveby"] = "Prise de vue au volant", + ["speeding"] = "Conduite dangereuse", + ["autotheft"] = "Vol d'un véhicule à moteur", + ["officerdown"] = "Officier est à terre", + ["persondown"] = "Personne est blessée", }, - ['da'] = { - ['unknown_caller'] = "Opkalder Ukendt", - ['caller_unknown'] = "Ukendt", - ['caller_local'] = "Lokal Borger", - ['call_from'] = "Opkald fra ", - ['two_door'] = "To-dørs ", - ['three_door'] = "Tre-dørs ", - ['four_door'] = "Fire-dørs ", - ['compact'] = "Compact", - ['sedan'] = "Sedan", - ['suv'] = "SUV", - ['coupe'] = "Coupe", - ['muscle'] = "Muscle car", - ['sports_classic'] = "Sports classic", - ['sports'] = "Sports car", - ['super'] = "Super car", - ['motorcycle'] = "Motorcycle", - ['offroad'] = "Off-road vehicle", - ['industrial'] = "Industrial vehicle", - ['utility'] = "Utility vehicle", - ['van'] = "Van", - ['service'] = "Service vehicle", - ['military'] = "Military vehicle", - ['truck'] = "Truck", - ['melee'] = "Slås kamp i gang", - ['shooting'] = "Skyderi i gang", - ['driveby'] = "Drive-by skyderi", - ['speeding'] = "Uansvarlig kørsel", - ['autotheft'] = "Tyveri af et køretøj", - ['officerdown'] = "KOLLEGA SKADET", - ['persondown'] = "Personen er såret", + ["da"] = { + ["unknown_caller"] = "Opkalder Ukendt", + ["caller_unknown"] = "Ukendt", + ["caller_local"] = "Lokal Borger", + ["call_from"] = "Opkald fra ", + ["two_door"] = "To-dørs ", + ["three_door"] = "Tre-dørs ", + ["four_door"] = "Fire-dørs ", + ["compact"] = "Compact", + ["sedan"] = "Sedan", + ["suv"] = "SUV", + ["coupe"] = "Coupe", + ["muscle"] = "Muscle car", + ["sports_classic"] = "Sports classic", + ["sports"] = "Sports car", + ["super"] = "Super car", + ["motorcycle"] = "Motorcycle", + ["offroad"] = "Off-road vehicle", + ["industrial"] = "Industrial vehicle", + ["utility"] = "Utility vehicle", + ["van"] = "Van", + ["service"] = "Service vehicle", + ["military"] = "Military vehicle", + ["truck"] = "Truck", + ["melee"] = "Slås kamp i gang", + ["shooting"] = "Skyderi i gang", + ["driveby"] = "Drive-by skyderi", + ["speeding"] = "Uansvarlig kørsel", + ["autotheft"] = "Tyveri af et køretøj", + ["officerdown"] = "KOLLEGA SKADET", + ["persondown"] = "Personen er såret", }, - - ['es'] = { - ['unknown_caller'] = "Llamante desconocido", - ['caller_unknown'] = "Desconocido", - ['caller_local'] = "Local", - ['call_from'] = "Llamada de", - ['two_door'] = "Dos puertas ", - ['three_door'] = "Tres puertas", - ['four_door'] = "Cuatro puertas ", - ['compact'] = "Compacto", - ['sedan'] = "Sedan", - ['suv'] = "Camioneta", - ['coupe'] = "Cupé", - ['muscle'] = "Auto de alta potencia", - ['sports_classic'] = "Deportivo clasico", - ['sports'] = "Vehiculo deportivo", - ['super'] = "Super Auto", - ['motorcycle'] = "Motocicleta", - ['offroad'] = "Vehiculo todo-terreno", - ['industrial'] = "Vehiculo insdustrial", - ['utility'] = "Vehiculo de utilidad", - ['van'] = "Van", - ['service'] = "Vehiculo de servicio", - ['military'] = "Vehiculo militar", - ['truck'] = "Camioneta", + + ["es"] = { + ["unknown_caller"] = "Llamante desconocido", + ["caller_unknown"] = "Desconocido", + ["caller_local"] = "Local", + ["call_from"] = "Llamada de", + ["two_door"] = "Dos puertas ", + ["three_door"] = "Tres puertas", + ["four_door"] = "Cuatro puertas ", + ["compact"] = "Compacto", + ["sedan"] = "Sedan", + ["suv"] = "Camioneta", + ["coupe"] = "Cupé", + ["muscle"] = "Auto de alta potencia", + ["sports_classic"] = "Deportivo clasico", + ["sports"] = "Vehiculo deportivo", + ["super"] = "Super Auto", + ["motorcycle"] = "Motocicleta", + ["offroad"] = "Vehiculo todo-terreno", + ["industrial"] = "Vehiculo insdustrial", + ["utility"] = "Vehiculo de utilidad", + ["van"] = "Van", + ["service"] = "Vehiculo de servicio", + ["military"] = "Vehiculo militar", + ["truck"] = "Camioneta", -- DISPATCH MESSAGES - ['vehicleshots'] = "Disparos desde vehículo", - ['shooting'] = "Descarga de un arma de fuego", - ['melee'] = "Pelea en progreso", - ['driveby'] = "Disparos desde vehículos en movimiento", - ['speeding'] = "Conducción temeraria", - ['autotheft'] = "Robo de un vehículo de motor", - ['persondown'] = "La persona esta lesionada", - ['storerobbery'] = "Robo de tienda", - ['fleecabank'] = "Robo del banco Fleeca", - ['paletobank'] = "Robo del Banco Paleto", - ['pacificbank'] = "Robo del Banco del Pacífico", - ['prisonbreak'] = "Escape de prision en progreso", - ['vangelico'] = "Robo a joyeria", - ['houserobbery'] = "Robo de casa", - ['drugsell'] = "Venta de droga sospechada", - ['carjacking'] = "Levantamiento de autos", - ['vehicletheft'] = "Robo de vehículos", - ['officerdown'] = "Socorro policia", - ['emsdown'] = "Socorro paramedico", - ['artgalleryrobbery'] = "Robo en galería de arte", - ['humanerobbery'] = "Robo de laboratorios humanos", - ['trainrobbery'] = "Robo de tren", - ['vanrobbery'] = "Robo de furgoneta de seguridad", - ['underground'] = "Robo de búnker", - ['drugboatrobbery'] = "Barco sospechoso", - ['unionrobbery'] = "Robo del depósito de la unión", - ['carboosting'] = "Impulso de coche en progreso", - ['yachtheist'] = "Atraco a Yate en curso", - ['susactivity'] = "Actividades sospechosas", + ["vehicleshots"] = "Disparos desde vehículo", + ["shooting"] = "Descarga de un arma de fuego", + ["melee"] = "Pelea en progreso", + ["driveby"] = "Disparos desde vehículos en movimiento", + ["speeding"] = "Conducción temeraria", + ["autotheft"] = "Robo de un vehículo de motor", + ["persondown"] = "La persona esta lesionada", + ["storerobbery"] = "Robo de tienda", + ["fleecabank"] = "Robo del banco Fleeca", + ["paletobank"] = "Robo del Banco Paleto", + ["pacificbank"] = "Robo del Banco del Pacífico", + ["prisonbreak"] = "Escape de prision en progreso", + ["vangelico"] = "Robo a joyeria", + ["houserobbery"] = "Robo de casa", + ["drugsell"] = "Venta de droga sospechada", + ["carjacking"] = "Levantamiento de autos", + ["vehicletheft"] = "Robo de vehículos", + ["officerdown"] = "Socorro policia", + ["emsdown"] = "Socorro paramedico", + ["artgalleryrobbery"] = "Robo en galería de arte", + ["humanerobbery"] = "Robo de laboratorios humanos", + ["trainrobbery"] = "Robo de tren", + ["vanrobbery"] = "Robo de furgoneta de seguridad", + ["underground"] = "Robo de búnker", + ["drugboatrobbery"] = "Barco sospechoso", + ["unionrobbery"] = "Robo del depósito de la unión", + ["carboosting"] = "Impulso de coche en progreso", + ["yachtheist"] = "Atraco a Yate en curso", + ["susactivity"] = "Actividades sospechosas", }, - ['de'] = { - ['unknown_caller'] = "Unbekannter Anrufer", - ['caller_unknown'] = "Unbekannt", - ['caller_local'] = "Lokal", - ['call_from'] = "Anruf von ", - ['two_door'] = "Zweitürer ", - ['three_door'] = "Dreitürer ", - ['four_door'] = "Viertürer ", - ['compact'] = "Kompakt", - ['sedan'] = "Sedan", - ['suv'] = "Geländewagen", - ['coupe'] = "Coupe", - ['muscle'] = "Muscle car", - ['sports_classic'] = "Sports Klassiker", - ['sports'] = "Sportwagen", - ['super'] = "Super Auto", - ['motorcycle'] = "Motorrad", - ['offroad'] = "Off-road Auto", - ['industrial'] = "Industrie Fahrzeug", - ['utility'] = "Nutzfahrzeug", - ['van'] = "Van", - ['service'] = "Service Auto", - ['military'] = "Militär Fahrzeug", - ['truck'] = "Truck", + ["de"] = { + ["unknown_caller"] = "Unbekannter Anrufer", + ["caller_unknown"] = "Unbekannt", + ["caller_local"] = "Lokal", + ["call_from"] = "Anruf von ", + ["two_door"] = "Zweitürer ", + ["three_door"] = "Dreitürer ", + ["four_door"] = "Viertürer ", + ["compact"] = "Kompakt", + ["sedan"] = "Sedan", + ["suv"] = "Geländewagen", + ["coupe"] = "Coupe", + ["muscle"] = "Muscle car", + ["sports_classic"] = "Sports Klassiker", + ["sports"] = "Sportwagen", + ["super"] = "Super Auto", + ["motorcycle"] = "Motorrad", + ["offroad"] = "Off-road Auto", + ["industrial"] = "Industrie Fahrzeug", + ["utility"] = "Nutzfahrzeug", + ["van"] = "Van", + ["service"] = "Service Auto", + ["military"] = "Militär Fahrzeug", + ["truck"] = "Truck", -- DISPATCH MESSAGES - ['vehicleshots'] = "Schüsse aus einem Auto", - ['shooting'] = "Schüsse wurden abgefeuert", - ['melee'] = "Angehender Kampf", - ['driveby'] = "Drive-by shooting", - ['speeding'] = "Rücksichtsloses Fahren", - ['autotheft'] = "Autodiebstahl", - ['persondown'] = "Verletzte Person", - ['storerobbery'] = "Ladendiebstahl", - ['fleecabank'] = "Bankraub in der Feleeca Bank", - ['paletobank'] = "Bankraub in der Paleto Bank", - ['pacificbank'] = "Bankraub in der Pacific Bank", - ['prisonbreak'] = "Gefängnisausbruch", - ['vangelico'] = "Raubüberfall auf Vangelico", - ['houserobbery'] = "Raubüberfall in privatem Haushalt", - ['drugsell'] = "Drogenverkauf", - ['carjacking'] = "Autoentführung", - ['vehicletheft'] = "Autodiebstahl", - ['officerdown'] = "Beamter am Boden", - ['emsdown'] = "Sanitäter am Boden", - ['artgalleryrobbery'] = "Überfall auf die Kunstgallerie", - ['humanerobbery'] = "Überfall bei Humane Labs", - ['trainrobbery'] = "Überfall auf einen Zug", - ['vanrobbery'] = "Überfall auf einen Sicherheitsvan", - ['underground'] = "Überfall auf einen Bunker", - ['drugboatrobbery'] = "Verdächtiges Boot", - ['unionrobbery'] = "Überfall auf Union Depository", - ['carboosting'] = "Car Boosting", - ['yachtheist'] = "Yacht Überfall", - ['susactivity'] = "Verdächtige Aktivität", - } + ["vehicleshots"] = "Schüsse aus einem Auto", + ["shooting"] = "Schüsse wurden abgefeuert", + ["melee"] = "Angehender Kampf", + ["driveby"] = "Drive-by shooting", + ["speeding"] = "Rücksichtsloses Fahren", + ["autotheft"] = "Autodiebstahl", + ["persondown"] = "Verletzte Person", + ["storerobbery"] = "Ladendiebstahl", + ["fleecabank"] = "Bankraub in der Feleeca Bank", + ["paletobank"] = "Bankraub in der Paleto Bank", + ["pacificbank"] = "Bankraub in der Pacific Bank", + ["prisonbreak"] = "Gefängnisausbruch", + ["vangelico"] = "Raubüberfall auf Vangelico", + ["houserobbery"] = "Raubüberfall in privatem Haushalt", + ["drugsell"] = "Drogenverkauf", + ["carjacking"] = "Autoentführung", + ["vehicletheft"] = "Autodiebstahl", + ["officerdown"] = "Beamter am Boden", + ["emsdown"] = "Sanitäter am Boden", + ["artgalleryrobbery"] = "Überfall auf die Kunstgallerie", + ["humanerobbery"] = "Überfall bei Humane Labs", + ["trainrobbery"] = "Überfall auf einen Zug", + ["vanrobbery"] = "Überfall auf einen Sicherheitsvan", + ["underground"] = "Überfall auf einen Bunker", + ["drugboatrobbery"] = "Verdächtiges Boot", + ["unionrobbery"] = "Überfall auf Union Depository", + ["carboosting"] = "Car Boosting", + ["yachtheist"] = "Yacht Überfall", + ["susactivity"] = "Verdächtige Aktivität", + }, } diff --git a/server-data/resources/[esx_addons]/ps-dispatch/server/sv_dispatchcodes.lua b/server-data/resources/[esx_addons]/ps-dispatch/server/sv_dispatchcodes.lua index 5b4c9fd8..d764fc87 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/server/sv_dispatchcodes.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/server/sv_dispatchcodes.lua @@ -1,55 +1,37 @@ - ---[[ - ["vehicleshots"] -> dispatchcodename that you pass with the event of AlertGunShot - displayCode -> Code to be displayed on the blip message - description -> Description of the blip message - radius -> to draw a circle with radius around blip ( the number need to have a .0 behind it, for example 150.0 or 75.0 ) - -> if u want to have the radius without the blip just make the blipScale = 0 - -> if u want to have the radius centered, disable the offset - recipientList -> list of job names that can see the blip - blipSprite -> blip sprite - blipColour -> blip colour - blipScale -> blip scale - blipLength -> time in seconds at which the blip will fade down, lower the time, faster it will fade. Cannot be 0 - offset -> enable or disable the offset for the radius ( radius on 0 and offset on true does nothing ) - blipflash -> enable or disable the flashing blip -]]-- - dispatchCodes = { - ["vehicleshots"] = {displayCode = '10-13', description = "Shots Fired from Vehicle", radius = 0, recipientList = {'police'}, blipSprite = 119, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["shooting"] = {displayCode = '10-13', description ="Shots Fired", radius = 0, recipientList = {'police'}, blipSprite = 110, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["speeding"] = {displayCode = '10-13', description = "Speeding", radius = 0, recipientList = {'police'}, blipSprite = 326, blipColour = 84, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["fight"] = {displayCode = '10-10', description = "Fight In Progress", radius = 0, recipientList = {'police'}, blipSprite = 685, blipColour = 69, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["civdown"] = {displayCode = '10-69', description = "Civilan Down", radius = 0, recipientList = {'ambulance'}, blipSprite = 126, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "dispatch", offset = "false", blipflash = "false"}, - ["civdead"] = {displayCode = '10-69', description = "Civilan Bled Out", radius = 0, recipientList = {'ambulance'}, blipSprite = 126, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "dispatch", offset = "false", blipflash = "false"}, - ["911call"] = {displayCode = '911', description = "911 Call", radius = 0, recipientList = {'police', 'ambulance'}, blipSprite = 480, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["311call"] = {displayCode = '911', description = "311 Call", radius = 0, recipientList = {'police', 'ambulance'}, blipSprite = 480, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["officerdown"] = {displayCode = '10-99', description = "Officer Down", radius = 15.0, recipientList = {'police', 'ambulance'}, blipSprite = 526, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "panicbutton", offset = "false", blipflash = "false"}, - ["emsdown"] = {displayCode = '10-99', description = "EMS Down", radius = 15.0, recipientList = {'police', 'ambulance'}, blipSprite = 526, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "panicbutton", offset = "false", blipflash = "false"}, - ["storerobbery"] = {displayCode = '10-90', description = "Store Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 52, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["bankrobbery"] = {displayCode = '10-90', description = "Fleeca Bank Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 500, blipColour = 2, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["paletobankrobbery"] = {displayCode = '10-90', description = "Paleto Bank Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 500, blipColour = 12, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["pacificbankrobbery"] = {displayCode = '10-90', description = "Pacific Bank Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 500, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["prisonbreak"] = {displayCode = '10-90', description = "Prison Break In Progress", radius = 0, recipientList = {'police'}, blipSprite = 189, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["vangelicorobbery"] = {displayCode = '10-90', description = "Vangelico Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 434, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["houserobbery"] = {displayCode = '10-90', description = "House Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 40, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["suspicioushandoff"] = {displayCode = '10-60', description = "Suspicious Hand off", radius = 120.0, recipientList = {'police'}, blipSprite = 469, blipColour = 52, blipScale = 0, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "true", blipflash = "false"}, - ["yachtheist"] = {displayCode = '10-65', description = "Yacht Heist In Progress", radius = 0, recipientList = {'police'}, blipSprite = 455, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["vehicletheft"] = {displayCode = '10-35', description = "Car Theft In Progress", radius = 0, recipientList = {'police'}, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["signrobbery"] = {displayCode = '10-35', description = "Sign Robbery Committed", radius = 0, recipientList = {'police'}, blipSprite = 358, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["susactivity"] = {displayCode = '10-66', description = "Suspicious Activity", radius = 0, recipientList = {'police'}, blipSprite = 66, blipColour = 37, blipScale = 0.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - - -- Rainmad Heists + ["vehicleshots"] = { displayCode = "10-13", description = "Shots Fired from Vehicle", radius = 0, recipientList = { "police" }, blipSprite = 119, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["shooting"] = { displayCode = "10-13", description = "Shots Fired", radius = 0, recipientList = { "police" }, blipSprite = 110, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["speeding"] = { displayCode = "10-13", description = "Speeding", radius = 0, recipientList = { "police" }, blipSprite = 326, blipColour = 84, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["fight"] = { displayCode = "10-10", description = "Fight In Progress", radius = 0, recipientList = { "police" }, blipSprite = 685, blipColour = 69, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["civdown"] = { displayCode = "10-69", description = "Civilan Down", radius = 0, recipientList = { "ambulance" }, blipSprite = 126, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "dispatch", offset = "false", blipflash = "false" }, + ["civdead"] = { displayCode = "10-69", description = "Civilan Bled Out", radius = 0, recipientList = { "ambulance" }, blipSprite = 126, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "dispatch", offset = "false", blipflash = "false" }, + ["911call"] = { displayCode = "911", description = "911 Call", radius = 0, recipientList = { "police", "ambulance" }, blipSprite = 480, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["311call"] = { displayCode = "911", description = "311 Call", radius = 0, recipientList = { "police", "ambulance" }, blipSprite = 480, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["officerdown"] = { displayCode = "10-99", description = "Officer Down", radius = 15.0, recipientList = { "police", "ambulance" }, blipSprite = 526, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "panicbutton", offset = "false", blipflash = "false" }, + ["emsdown"] = { displayCode = "10-99", description = "EMS Down", radius = 15.0, recipientList = { "police", "ambulance" }, blipSprite = 526, blipColour = 3, blipScale = 1.5, blipLength = 2, sound = "panicbutton", offset = "false", blipflash = "false" }, + ["storerobbery"] = { displayCode = "10-90", description = "Store Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 52, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["bankrobbery"] = { displayCode = "10-90", description = "Fleeca Bank Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 500, blipColour = 2, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["paletobankrobbery"] = { displayCode = "10-90", description = "Paleto Bank Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 500, blipColour = 12, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["pacificbankrobbery"] = { displayCode = "10-90", description = "Pacific Bank Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 500, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["prisonbreak"] = { displayCode = "10-90", description = "Prison Break In Progress", radius = 0, recipientList = { "police" }, blipSprite = 189, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["vangelicorobbery"] = { displayCode = "10-90", description = "Vangelico Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 434, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["houserobbery"] = { displayCode = "10-90", description = "House Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 40, blipColour = 5, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["suspicioushandoff"] = { displayCode = "10-60", description = "Suspicious Hand off", radius = 120.0, recipientList = { "police" }, blipSprite = 469, blipColour = 52, blipScale = 0, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "true", blipflash = "false" }, + ["yachtheist"] = { displayCode = "10-65", description = "Yacht Heist In Progress", radius = 0, recipientList = { "police" }, blipSprite = 455, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["vehicletheft"] = { displayCode = "10-35", description = "Car Theft In Progress", radius = 0, recipientList = { "police" }, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["signrobbery"] = { displayCode = "10-35", description = "Sign Robbery Committed", radius = 0, recipientList = { "police" }, blipSprite = 358, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["susactivity"] = { displayCode = "10-66", description = "Suspicious Activity", radius = 0, recipientList = { "police" }, blipSprite = 66, blipColour = 37, blipScale = 0.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, - ["artgalleryrobbery"] = {displayCode = '10-90', description = "Art Gallery Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 269, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["humanelabsrobbery"] = {displayCode = '10-90', description = "Humane Labs Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 499, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["trainrobbery"] = {displayCode = '10-90', description = "Train Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 667, blipColour = 78, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["vanrobbery"] = {displayCode = '10-90', description = "Security Van Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 67, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["undergroundrobbery"] = {displayCode = '10-90', description = "Underground Tunnels Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 486, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["drugboatrobbery"] = {displayCode = '10-31', description = "Suspicious Activity On Boat", radius = 0, recipientList = {'police'}, blipSprite = 427, blipColour = 26, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["unionrobbery"] = {displayCode = '10-90', description = "Union Depository Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 500, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false"}, - ["carboosting"] = {displayCode = '10-50', description = "Car Boosting In Progress", radius = 0, recipientList = {'police'}, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["carjack"] = {displayCode = '10-35', description = "Car Theft In Progress", radius = 0, recipientList = {'police'}, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, - ["explosion"] = {displayCode = '10-80', description = "Explosion Reported", radius = 0, recipientList = {'police'}, blipSprite = 436, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"}, + -- Rainmad Heists + ["artgalleryrobbery"] = { displayCode = "10-90", description = "Art Gallery Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 269, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["humanelabsrobbery"] = { displayCode = "10-90", description = "Humane Labs Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 499, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["trainrobbery"] = { displayCode = "10-90", description = "Train Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 667, blipColour = 78, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["vanrobbery"] = { displayCode = "10-90", description = "Security Van Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 67, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["undergroundrobbery"] = { displayCode = "10-90", description = "Underground Tunnels Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 486, blipColour = 59, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["drugboatrobbery"] = { displayCode = "10-31", description = "Suspicious Activity On Boat", radius = 0, recipientList = { "police" }, blipSprite = 427, blipColour = 26, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["unionrobbery"] = { displayCode = "10-90", description = "Union Depository Robbery In Progress", radius = 0, recipientList = { "police" }, blipSprite = 500, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "robberysound", offset = "false", blipflash = "false" }, + ["carboosting"] = { displayCode = "10-50", description = "Car Boosting In Progress", radius = 0, recipientList = { "police" }, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["carjack"] = { displayCode = "10-35", description = "Car Theft In Progress", radius = 0, recipientList = { "police" }, blipSprite = 595, blipColour = 60, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, + ["explosion"] = { displayCode = "10-80", description = "Explosion Reported", radius = 0, recipientList = { "police" }, blipSprite = 436, blipColour = 1, blipScale = 1.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false" }, } diff --git a/server-data/resources/[esx_addons]/ps-dispatch/server/sv_main.lua b/server-data/resources/[esx_addons]/ps-dispatch/server/sv_main.lua index 187c61bf..9e4008ec 100644 --- a/server-data/resources/[esx_addons]/ps-dispatch/server/sv_main.lua +++ b/server-data/resources/[esx_addons]/ps-dispatch/server/sv_main.lua @@ -2,7 +2,7 @@ local calls = {} local recentCalls = {} function _U(entry) - return Locales[Config.Locale][entry] + return Locales[Config.Locale][entry] end local function IsPoliceJob(job) @@ -24,13 +24,13 @@ local function IsDispatchJob(job) end RegisterServerEvent("dispatch:server:notify", function(data) - local newId = #calls + 1 - calls[newId] = data - calls[newId]['source'] = source - calls[newId]['callId'] = newId - calls[newId]['units'] = {} - calls[newId]['responses'] = {} - calls[newId]['time'] = os.time() * 1000 + local newId = #calls + 1 + calls[newId] = data + calls[newId]["source"] = source + calls[newId]["callId"] = newId + calls[newId]["units"] = {} + calls[newId]["responses"] = {} + calls[newId]["time"] = os.time() * 1000 local recentSize = #recentCalls @@ -40,38 +40,42 @@ RegisterServerEvent("dispatch:server:notify", function(data) table.insert(recentCalls, calls[newId]) - TriggerClientEvent('dispatch:clNotify', -1, data, newId, source) - if not data.alert then + TriggerClientEvent("dispatch:clNotify", -1, data, newId, source) + if not data.alert then TriggerClientEvent("ps-dispatch:client:AddCallBlip", -1, data.origin, dispatchCodes[data.dispatchcodename], newId) else TriggerClientEvent("ps-dispatch:client:AddCallBlip", -1, data.origin, data.alert, newId) end end) -function GetRecentDispatchCalls() return recentCalls end -exports('GetRecentDispatchCalls', GetRecentDispatchCalls) -- +function GetRecentDispatchCalls() + return recentCalls +end +exports("GetRecentDispatchCalls", GetRecentDispatchCalls) -function GetDispatchCalls() return calls end -exports('GetDispatchCalls', GetDispatchCalls) -- +function GetDispatchCalls() + return calls +end +exports("GetDispatchCalls", GetDispatchCalls) -- this is mdt call AddEventHandler("dispatch:addUnit", function(callid, player, cb) if calls[callid] then - if #calls[callid]['units'] > 0 then - for i=1, #calls[callid]['units'] do - if calls[callid]['units'][i]['cid'] == player.cid then - cb(#calls[callid]['units']) + if #calls[callid]["units"] > 0 then + for i = 1, #calls[callid]["units"] do + if calls[callid]["units"][i]["cid"] == player.cid then + cb(#calls[callid]["units"]) return end end end if IsPoliceJob(player.job.name) then - calls[callid]['units'][#calls[callid]['units']+1] = { cid = player.cid, fullname = player.fullname, job = 'Police', callsign = player.callsign } - elseif player.job.name == 'ambulance' then - calls[callid]['units'][#calls[callid]['units']+1] = { cid = player.cid, fullname = player.fullname, job = 'EMS', callsign = player.callsign } + calls[callid]["units"][#calls[callid]["units"] + 1] = { cid = player.cid, fullname = player.fullname, job = "Police", callsign = player.callsign } + elseif player.job.name == "ambulance" then + calls[callid]["units"][#calls[callid]["units"] + 1] = { cid = player.cid, fullname = player.fullname, job = "EMS", callsign = player.callsign } end - cb(#calls[callid]['units']) + cb(#calls[callid]["units"]) end end) @@ -79,14 +83,14 @@ AddEventHandler("dispatch:sendCallResponse", function(player, callid, message, t local Player = Functions[Config.Core].GetPlayer(player) local name = Functions[Config.Core].GetName(Player) if calls[callid] then - calls[callid]['responses'][#calls[callid]['responses']+1] = { + calls[callid]["responses"][#calls[callid]["responses"] + 1] = { name = name, message = message, - time = time + time = time, } - local player = calls[callid]['source'] + local player = calls[callid]["source"] if GetPlayerPing(player) > 0 then - TriggerClientEvent('dispatch:getCallResponse', player, message) + TriggerClientEvent("dispatch:getCallResponse", player, message) end cb(true) else @@ -98,36 +102,37 @@ end) AddEventHandler("dispatch:removeUnit", function(callid, player, cb) if calls[callid] then local newCallUnits = {} - local oldCallUnits = calls[callid]['units'] + local oldCallUnits = calls[callid]["units"] for k, v in ipairs(oldCallUnits) do - if v['cid'] ~= player.cid then + if v["cid"] ~= player.cid then table.insert(newCallUnits, v) end end - calls[callid]['units'] = newCallUnits - cb(#calls[callid]['units']) - end + calls[callid]["units"] = newCallUnits + cb(#calls[callid]["units"]) + end end) - -RegisterCommand('togglealerts', function(source, args, user) - local source = source +RegisterCommand("togglealerts", function(source, args, user) + local source = source local Player = Functions[Config.Core].GetPlayer(source) - local job = Functions[Config.Core].GetJob(Player) + local job = Functions[Config.Core].GetJob(Player) - if IsPoliceJob(job.name) or job.name == 'ambulance' then - TriggerClientEvent('dispatch:manageNotifs', source, args[1]) - end + if IsPoliceJob(job.name) or job.name == "ambulance" then + TriggerClientEvent("dispatch:manageNotifs", source, args[1]) + end end) -- Explosion Handler local ExplosionCooldown = false -AddEventHandler('explosionEvent', function(source, info) - if ExplosionCooldown then return end +AddEventHandler("explosionEvent", function(source, info) + if ExplosionCooldown then + return + end - for i = 1, (#Config.ExplosionTypes) do + for i = 1, #Config.ExplosionTypes do if info.explosionType == Config.ExplosionTypes[i] then TriggerClientEvent("ps-dispatch:client:Explosion", source) ExplosionCooldown = true @@ -142,8 +147,6 @@ Functions[Config.Core].RegisterCommand("clearblip", "Clear all dispatch blips", local job = Functions[Config.Core].GetJob(player) if IsDispatchJob(job) then - TriggerClientEvent('ps-dispatch:client:clearAllBlips', src) + TriggerClientEvent("ps-dispatch:client:clearAllBlips", src) end end) - -