From 5ab3c0f483f4895579fe2e4d574b2b080a4b3722 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:45:45 +0100 Subject: [PATCH 1/9] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b89f7797..c7151fba 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,10 @@ Do not create issues on GitHub if you need help. Issues are for bug reporting an - On shared/config.lua make set Config.Debug = true to test calls as police officer.(ONLY to be used as testing, make sure to disable on live production) * How to change colors of the calls? - - Priority 1 is red and priority 2 is normal on the config. + - Priority 1 is red and priority 2 is normal on the config. + +* How to make the calls last longer on the screen? + - Go into alerts.lua and change the ,,alertTime = nil'' to ,,alertTime = 10'' for 10 seconds. # Credits * [OK1ez](https://github.com/OK1ez) From e0ce9133d81eb7bb24a93883b5de84fd202b85df Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:46:45 +0100 Subject: [PATCH 2/9] Update alerts.lua --- client/alerts.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/alerts.lua b/client/alerts.lua index 48a2b781..c35a0d15 100644 --- a/client/alerts.lua +++ b/client/alerts.lua @@ -16,6 +16,7 @@ local function VehicleTheft() color = vehicle.color, class = vehicle.class, doors = vehicle.doors, + alertTime = nil, jobs = { 'leo' } } @@ -36,6 +37,7 @@ local function Shooting() street = GetStreetAndZone(coords), gender = GetPlayerGender(), weapon = GetWeaponName(), + alertTime = nil, jobs = { 'leo' } } @@ -56,6 +58,7 @@ local function Hunting() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -82,6 +85,7 @@ local function VehicleShooting() color = vehicle.color, class = vehicle.class, doors = vehicle.doors, + alertTime = nil, jobs = { 'leo' } } @@ -107,6 +111,7 @@ local function SpeedingVehicle() color = vehicle.color, class = vehicle.class, doors = vehicle.doors, + alertTime = nil, jobs = { 'leo' } } @@ -126,6 +131,7 @@ local function Fight() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -145,6 +151,7 @@ local function PrisonBreak() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -165,6 +172,7 @@ local function StoreRobbery(camId) gender = GetPlayerGender(), street = GetStreetAndZone(coords), camId = camId, + alertTime = nil, jobs = { 'leo' } } @@ -185,6 +193,7 @@ local function FleecaBankRobbery(camId) gender = GetPlayerGender(), street = GetStreetAndZone(coords), camId = camId, + alertTime = nil, jobs = { 'leo' } } @@ -205,6 +214,7 @@ local function PaletoBankRobbery(camId) gender = GetPlayerGender(), street = GetStreetAndZone(coords), camId = camId, + alertTime = nil, jobs = { 'leo' } } @@ -225,6 +235,7 @@ local function PacificBankRobbery(camId) gender = GetPlayerGender(), street = GetStreetAndZone(coords), camId = camId, + alertTime = nil, jobs = { 'leo' } } @@ -245,6 +256,7 @@ local function VangelicoRobbery(camId) gender = GetPlayerGender(), street = GetStreetAndZone(coords), camId = camId, + alertTime = nil, jobs = { 'leo' } } @@ -264,6 +276,7 @@ local function HouseRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -283,6 +296,7 @@ local function YachtHeist() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -302,6 +316,7 @@ local function DrugSale() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -321,6 +336,7 @@ local function SuspiciousActivity() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -346,6 +362,7 @@ local function CarJacking(vehicle) color = vehicle.color, class = vehicle.class, doors = vehicle.doors, + alertTime = nil, jobs = { 'leo' } } @@ -365,6 +382,7 @@ local function InjuriedPerson() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = 10, jobs = { 'ems' } } @@ -384,6 +402,7 @@ local function DeceasedPerson() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = 10, jobs = { 'ems' } } @@ -405,6 +424,7 @@ local function OfficerDown() street = GetStreetAndZone(coords), name = PlayerData.charinfo.firstname .. " " .. PlayerData.charinfo.lastname, callsign = PlayerData.metadata["callsign"], + alertTime = 10, jobs = { 'ems', 'leo' } } @@ -428,6 +448,7 @@ local function OfficerBackup() street = GetStreetAndZone(coords), name = PlayerData.charinfo.firstname .. " " .. PlayerData.charinfo.lastname, callsign = PlayerData.metadata["callsign"], + alertTime = 10, jobs = { 'ems', 'leo' } } @@ -451,6 +472,7 @@ local function OfficerInDistress() street = GetStreetAndZone(coords), name = PlayerData.charinfo.firstname .. " " .. PlayerData.charinfo.lastname, callsign = PlayerData.metadata["callsign"], + alertTime = 10, jobs = { 'ems', 'leo' } } @@ -472,6 +494,7 @@ local function EmsDown() street = GetStreetAndZone(coords), name = PlayerData.charinfo.firstname .. " " .. PlayerData.charinfo.lastname, callsign = PlayerData.metadata["callsign"], + alertTime = 10, jobs = { 'ems', 'leo' } } @@ -493,6 +516,7 @@ local function Explosion() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -522,6 +546,7 @@ local function CustomAlert(data) name = data.name or nil, vehicle = data.model or nil, plate = data.plate or nil, + alertTime = data.alertTime or nil, doorCount = data.doorCount or nil, automaticGunfire = data.automaticGunfire or false, alert = { @@ -562,6 +587,7 @@ local function PhoneCall(message, anonymous, job) number = anonymous and locale('hidden_number') or PlayerData.charinfo.phone, information = message, street = GetStreetAndZone(coords), + alertTime = nil, jobs = job } @@ -591,6 +617,7 @@ local function ArtGalleryRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } TriggerServerEvent('ps-dispatch:server:notify', dispatchData) @@ -609,6 +636,7 @@ local function HumaneRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } TriggerServerEvent('ps-dispatch:server:notify', dispatchData) @@ -628,6 +656,7 @@ local function TrainRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } TriggerServerEvent('ps-dispatch:server:notify', dispatchData) @@ -647,6 +676,7 @@ local function VanRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } TriggerServerEvent('ps-dispatch:server:notify', dispatchData) @@ -666,6 +696,7 @@ local function UndergroundRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } TriggerServerEvent('ps-dispatch:server:notify', dispatchData) @@ -684,6 +715,7 @@ local function DrugBoatRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -703,6 +735,7 @@ local function UnionRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo' } } @@ -728,6 +761,7 @@ local function CarBoosting(vehicle) color = vehicle.color, class = vehicle.class, doors = vehicle.doors, + alertTime = nil, jobs = { 'leo' } } @@ -747,6 +781,7 @@ local function SignRobbery() coords = coords, gender = GetPlayerGender(), street = GetStreetAndZone(coords), + alertTime = nil, jobs = { 'leo'} } From f1cdc80cff964c44aafe5b9c8b1f3e845a9f439a Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:47:44 +0100 Subject: [PATCH 3/9] Update main.lua --- client/main.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 146f6140..44287b8f 100644 --- a/client/main.lua +++ b/client/main.lua @@ -83,12 +83,15 @@ local function setWaypoint() if not data then return end + local timer = data.alertTime * 1000 + if timer == nil then timer = Config.AlertTime * 1000 end + if not waypointCooldown and lib.table.contains(data.jobs, PlayerData.job.type) then SetNewWaypoint(data.coords.x, data.coords.y) TriggerServerEvent('ps-dispatch:server:attach', data.id, PlayerData) lib.notify({ description = locale('waypoint_set'), position = 'top', type = 'success' }) waypointCooldown = true - SetTimeout(Config.AlertTime * 1000, function() + SetTimeout(timer, function() waypointCooldown = false end) end @@ -243,7 +246,9 @@ local OpenDispatchMenu = lib.addKeybind({ -- Events RegisterNetEvent('ps-dispatch:client:notify', function(data, source) - local timer = Config.AlertTime * 1000 + local timer = data.alertTime * 1000 + if timer == 10 then timer = Config.AlertTime * 1000 end + if alertsDisabled then return end if not isJobValid(data.jobs) then return end if not IsOnDuty() then return end From 6d1eebb7ce37ecf33a9d1744616d57a9c27aa23c Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:50:27 +0100 Subject: [PATCH 4/9] Update config.lua --- shared/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/config.lua b/shared/config.lua index dd99f806..d82aef89 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -4,7 +4,7 @@ Config.Debug = false -- Enables debug and send alerts when leo break the law. Config.RespondKeybind = 'E' Config.OpenDispatchMenu = 'O' -Config.AlertTime = 5 -- How many seconds you want the alert to stay on screen +Config.AlertTime = 5 -- How many seconds you want the alert to stay on screen ( this only works if the alertTime = nil, editable in the alerts.lua) Config.MaxCallList = 25 -- maximum dispatch calls in dispatch list Config.OnDutyOnly = true -- Set true if only on duty players can see the alert From a7d0c7bde73bf15098a48732fdf26afca8cf6abc Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:10:02 +0100 Subject: [PATCH 5/9] Update main.lua --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 44287b8f..1cf3e66a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -247,7 +247,7 @@ local OpenDispatchMenu = lib.addKeybind({ -- Events RegisterNetEvent('ps-dispatch:client:notify', function(data, source) local timer = data.alertTime * 1000 - if timer == 10 then timer = Config.AlertTime * 1000 end + if timer == nil then timer = Config.AlertTime * 1000 end if alertsDisabled then return end if not isJobValid(data.jobs) then return end From f2e2c047c5af57e9766cca8af60c561d1b614ac8 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Fri, 15 Dec 2023 18:08:42 +0100 Subject: [PATCH 6/9] final fix XD final fix XD --- client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 1cf3e66a..280576c2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -83,8 +83,8 @@ local function setWaypoint() if not data then return end + if data.alertTime == nil then data.alertTime = Config.AlertTime end local timer = data.alertTime * 1000 - if timer == nil then timer = Config.AlertTime * 1000 end if not waypointCooldown and lib.table.contains(data.jobs, PlayerData.job.type) then SetNewWaypoint(data.coords.x, data.coords.y) @@ -246,8 +246,8 @@ local OpenDispatchMenu = lib.addKeybind({ -- Events RegisterNetEvent('ps-dispatch:client:notify', function(data, source) + if data.alertTime == nil then data.alertTime = Config.AlertTime end local timer = data.alertTime * 1000 - if timer == nil then timer = Config.AlertTime * 1000 end if alertsDisabled then return end if not isJobValid(data.jobs) then return end From 667f7cd3c2201b5e3605f4fd1dbb4db9d6461975 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:12:02 +0100 Subject: [PATCH 7/9] updated readme, should be fine now updated readme, should be fine now --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c7151fba..7e376bbb 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,11 @@ Do not create issues on GitHub if you need help. Issues are for bug reporting an * How to change colors of the calls? - Priority 1 is red and priority 2 is normal on the config. -* How to make the calls last longer on the screen? - - Go into alerts.lua and change the ,,alertTime = nil'' to ,,alertTime = 10'' for 10 seconds. +* To extend the duration of calls displayed on the screen, follow these steps: + - Locate the file named "alerts.lua." (Client Folder) + - Open the file using a text editor or an integrated development environment (VSC). + - Search for the line of code that reads "alertTime = nil" + - Change the value assigned to "alertTime" from "nil" to the desired duration in seconds. ( alertTime = 25 -> 25 seconds ) # Credits * [OK1ez](https://github.com/OK1ez) From ad48802d1b72319c21fa44ebd460377f5246d8ea Mon Sep 17 00:00:00 2001 From: MonkeyWhisper <82112471+MonkeyWhisper@users.noreply.github.com> Date: Tue, 2 Jan 2024 18:56:03 -0500 Subject: [PATCH 8/9] Update config.lua --- shared/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/config.lua b/shared/config.lua index d82aef89..5a4d58df 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -4,7 +4,7 @@ Config.Debug = false -- Enables debug and send alerts when leo break the law. Config.RespondKeybind = 'E' Config.OpenDispatchMenu = 'O' -Config.AlertTime = 5 -- How many seconds you want the alert to stay on screen ( this only works if the alertTime = nil, editable in the alerts.lua) +Config.AlertTime = 5 -- Specify the duration for the alert to appear on the screen. The default time is 5 seconds for all alerts. To set a different duration for specific alerts, change the value in `alertTime = nil` found in the alerts.lua file. Config.MaxCallList = 25 -- maximum dispatch calls in dispatch list Config.OnDutyOnly = true -- Set true if only on duty players can see the alert From 27f4d4cd336c3c8137bed106a5240f20cfa9cb54 Mon Sep 17 00:00:00 2001 From: MonkeyWhisper <82112471+MonkeyWhisper@users.noreply.github.com> Date: Tue, 2 Jan 2024 18:57:52 -0500 Subject: [PATCH 9/9] Updated instructions --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7e376bbb..c8288963 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,11 @@ Do not create issues on GitHub if you need help. Issues are for bug reporting an * How to change colors of the calls? - Priority 1 is red and priority 2 is normal on the config. -* To extend the duration of calls displayed on the screen, follow these steps: - - Locate the file named "alerts.lua." (Client Folder) - - Open the file using a text editor or an integrated development environment (VSC). - - Search for the line of code that reads "alertTime = nil" - - Change the value assigned to "alertTime" from "nil" to the desired duration in seconds. ( alertTime = 25 -> 25 seconds ) +* To increase the time that calls are shown on the screen, do the following: + - Find the "alerts.lua" file in the client folder. + - Open this file with a text editor or a development tool like Visual Studio Code. + - Look for the code "alertTime = nil". + - Replace "nil" with the number of seconds you want the calls to display. For example, setting "alertTime = 25" means calls will be shown for 25 seconds. # Credits * [OK1ez](https://github.com/OK1ez)