From 86fb94c656d3d08070f4a3894a3db52eac01fa4c Mon Sep 17 00:00:00 2001 From: Jacob <42719082+ThatGuyJacobee@users.noreply.github.com> Date: Fri, 29 Apr 2022 20:11:22 +0100 Subject: [PATCH] Added Notifications to vehicle failure script. + Updated RealisticVehicleFailure script. --- hypnonema.db | Bin 28672 -> 28672 bytes resources/RealisticVehicleFailure/client.lua | 30 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/hypnonema.db b/hypnonema.db index 1e5565b6aa6d4804b2c6b4d2a021aa87ebbe742a..a2e65974b43ab1e5aa46321268efb0810f9d7234 100644 GIT binary patch delta 23 dcmZp8z}WDBae^tk1H*qHV4K*exiNKiJ^+Ew3oHNt delta 23 dcmZp8z}WDBae^tkHN$@(V4K*exiNKiJ^+D<3nu^o diff --git a/resources/RealisticVehicleFailure/client.lua b/resources/RealisticVehicleFailure/client.lua index 478f46e00..945beb064 100644 --- a/resources/RealisticVehicleFailure/client.lua +++ b/resources/RealisticVehicleFailure/client.lua @@ -179,7 +179,8 @@ AddEventHandler('iens:repair', function() healthEngineLast=1000.0 healthPetrolTankLast=1000.0 SetVehicleEngineOn(vehicle, true, false ) - notification("~g~The mechanic repaired your car!") + exports['EGRP-Notifications']:CaptionIcon("Vehicle System", "Mechanic has repaired your vehicle!", "top", 3000, "dark", "", true, "mdi-wrench") + --notification("~g~The mechanic repaired your car!") return end if GetVehicleEngineHealth(vehicle) < cfg.cascadingFailureThreshold + 5 then @@ -191,19 +192,23 @@ AddEventHandler('iens:repair', function() healthPetrolTankLast=750.0 SetVehicleEngineOn(vehicle, true, false ) SetVehicleOilLevel(vehicle,(GetVehicleOilLevel(vehicle)/3)-0.5) - notification("~g~" .. repairCfg.fixMessages[fixMessagePos] .. ", now get to a mechanic!") + exports['EGRP-Notifications']:CaptionIcon("Vehicle System", ""..repairCfg.fixMessages[fixMessagePos]..", now get to a mechanic!", "top", 3000, "dark", "", true, "mdi-wrench") + --notification("~g~" .. repairCfg.fixMessages[fixMessagePos] .. ", now get to a mechanic!") fixMessagePos = fixMessagePos + 1 if fixMessagePos > repairCfg.fixMessageCount then fixMessagePos = 1 end else - notification("~r~Your vehicle was too badly damaged. Unable to repair!") + exports['EGRP-Notifications']:Negative("System", "Vehicle too badly damaged, unable to repair!", "top", 3000, true) + --notification("~r~Your vehicle was too badly damaged. Unable to repair!") end else - notification("~y~" .. repairCfg.noFixMessages[noFixMessagePos] ) + exports['EGRP-Notifications']:Warning("System", ""..repairCfg.noFixMessages[noFixMessagePos].."!", "top", 3000, true) + --notification("~y~" .. repairCfg.noFixMessages[noFixMessagePos] ) noFixMessagePos = noFixMessagePos + 1 if noFixMessagePos > repairCfg.noFixMessageCount then noFixMessagePos = 1 end end else - notification("~y~You must be in a vehicle to be able to repair it") + exports['EGRP-Notifications']:Negative("System", "You must be in a vehicle to repair it!", "top", 3000, true) + --notification("~y~You must be in a vehicle to be able to repair it") end end) @@ -219,7 +224,8 @@ AddEventHandler('iens:fix', function() healthEngineLast=1000.0 healthPetrolTankLast=1000.0 SetVehicleEngineOn(vehicle, true, false ) - notification("~g~The mechanic repaired your car!") + exports['EGRP-Notifications']:CaptionIcon("Vehicle System", "Mechanic has repaired your vehicle!", "top", 3000, "dark", "", true, "mdi-wrench") + --notification("~g~The mechanic repaired your car!") return end if GetVehicleEngineHealth(vehicle) < cfg.cascadingFailureThreshold + 5 then @@ -231,19 +237,23 @@ AddEventHandler('iens:fix', function() healthPetrolTankLast=750.0 SetVehicleEngineOn(vehicle, true, false ) SetVehicleOilLevel(vehicle,(GetVehicleOilLevel(vehicle)/3)-0.5) - notification("~g~" .. repairCfg.fixMessages[fixMessagePos] .. ", now get to a mechanic!") + exports['EGRP-Notifications']:CaptionIcon("Vehicle System", ""..repairCfg.fixMessages[fixMessagePos]..", now get to a mechanic!", "top", 3000, "dark", "", true, "mdi-wrench") + --notification("~g~" .. repairCfg.fixMessages[fixMessagePos] .. ", now get to a mechanic!") fixMessagePos = fixMessagePos + 1 if fixMessagePos > repairCfg.fixMessageCount then fixMessagePos = 1 end else - notification("~r~Your vehicle was too badly damaged. Unable to repair!") + exports['EGRP-Notifications']:Negative("System", "Vehicle too badly damaged, unable to repair!", "top", 3000, true) + --notification("~r~Your vehicle was too badly damaged. Unable to repair!") end else - notification("~y~" .. repairCfg.noFixMessages[noFixMessagePos] ) + exports['EGRP-Notifications']:Warning("System", ""..repairCfg.noFixMessages[noFixMessagePos].."!", "top", 3000, true) + --notification("~y~" .. repairCfg.noFixMessages[noFixMessagePos] ) noFixMessagePos = noFixMessagePos + 1 if noFixMessagePos > repairCfg.noFixMessageCount then noFixMessagePos = 1 end end else - notification("~y~You must be in a vehicle to be able to repair it") + exports['EGRP-Notifications']:Negative("System", "You must be in a vehicle to repair it!", "top", 3000, true) + --notification("~y~You must be in a vehicle to be able to repair it") end end)