Files
Elite-Gaming-FiveM/resources/CarWipe/client/client.lua
T
Jacob bfea14f326 Notifications Update!
+ Added notifications (EGRP-Notifications) exports to many different scripts including Engine-Toggle, Seatbelt, CarWipe and Head-Tags.
2022-04-27 22:31:31 +01:00

80 lines
4.0 KiB
Lua

RegisterNetEvent("delall")
AddEventHandler("delall", function ()
if Config.alerts then
exports['EGRP-Notifications']:Warning("System", "Vehicles will be wiped in 1 minute. Stay in your vehicle to prevent deletion.", "top", 5000, true)
--TriggerEvent("chat:addMessage", {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Vehicles will be wiped in ^*^11 minute.^r Stay in your vehicle if you do not want it to be deleted."}})
Citizen.Wait(30000)
exports['EGRP-Notifications']:Warning("System", "Vehicles will be wiped in 30 seconds. Stay in your vehicle to prevent deletion.", "top", 5000, true)
--TriggerEvent("chat:addMessage", {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Vehicles will be wiped in ^*^130 seconds.^r Stay in your vehicle if you do not want it to be deleted."}})
Citizen.Wait(25000)
exports['EGRP-Notifications']:Warning("System", "Vehicles will be wiped in 5 seconds. Stay in your vehicle to prevent deletion.", "top", 5000, true)
--TriggerEvent("chat:addMessage", {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Vehicles will be wiped in ^*^15 seconds.^r Stay in your vehicle if you do not want it to be deleted."}})
Citizen.Wait(5000)
end
Citizen.Wait(1000)
for vehicle in EnumerateVehicles() do
if (not IsPedAPlayer(GetPedInVehicleSeat(vehicle, -1))) then
if Config.OnlyWipeBroken == true then
if GetVehicleEngineHealth(vehicle) <= 100.0 then
SetVehicleHasBeenOwnedByPlayer(vehicle, false)
SetEntityAsMissionEntity(vehicle, false, false)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
if (DoesEntityExist(vehicle)) then
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
end
end
else
SetVehicleHasBeenOwnedByPlayer(vehicle, false)
SetEntityAsMissionEntity(vehicle, false, false)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
if (DoesEntityExist(vehicle)) then
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
DeleteVehicle(vehicle)
if Config.UseESX then
ESX.Game.DeleteVehicle(vehicle)
end
DeleteEntity(vehicle)
end
end
if Config.use10msdelay then
Citizen.Wait(10)
end
end
end
if Config.DoneNotify then
exports['EGRP-Notifications']:Success("System", "Vehicles have been successfully wiped!", "top", 5000, true)
--TriggerEvent("chat:addMessage", {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Vehicles have been wiped!"}})
end
end)