[ESX] outlawalert (WildFire alerts and Hypaste MDT integration)

I’m using a modified version of WF Alerts which is included in the resource, no need to install it too.

2 Likes

Hey hey! Loving this so much! Is there a way that I can move the notifications to display on the bottom right?

1 Like

Add -webkit-transform:rotate(180deg); to both .notif-container and .notification in style.css

2 Likes

May I ask where in esx_jewlrobbery this would go?

RegisterServerEvent('esx_JewelRobbery:policenotify')
AddEventHandler('esx_JewelRobbery:policenotify', function()
    local data = {displayCode = '211', description = 'Robbery', isImportant = 0, recipientList = {'police'}, length = '10000', infoM = 'fa-info-circle', info = 'Vangelico Jewelry Store'}
    local dispatchData = {dispatchData = data, caller = 'Alarm', street = 'Portola Dr, Rockford Hills', coords = vector3(-633.9, -241.7, 38.1)}
    TriggerEvent('wf-alerts:svNotify', dispatchData)
end)

Should work. Replace the existing event.

You are my hero!

There are two other scripts I am trying to implement with, if you could help with those I will love you longer time!
[Release] [ESX] loffe_robbery <— shop robberies
[Release] BadgerBankRobbery ← bank robberies

hey just a quick question im looking to make these alerts stay on the screen longer! how do i edit this?

That’s the pData.length variable in client.lua (it’s in ms, e.g. 4000 = 4 seconds by default)

awesome thank you so much it seems like the script was working but now when someone shoots its not showing up? is there a cooldown timer for these alerts? if so which line of code is that in? i want every shot to be an alert for example

There should be a cooldown, of course, but I dont exactly recall where it is, so you’re sorta on your own there :smiley:

ok ill try to look as well i have changed the alert time to stay on for 30 secs and it doesnt stay it still results back to the 4 secs?

Modifying if not pData.length then pData.length = 4000 end will change the length to 4 seconds for alerts that do not have their own set (speeding and autotheft).

Shooting is set to 6 seconds in its own data table, so you need to modify length = 6000 to the desired amount or remove it and increase the default length above.

At the top of client.lua there’s a for loop to create timers for each alert type

    if notLoaded then
        for k, v in pairs(Config.Enable) do
            if Config.Enable[k] ~= false then
                Config[k] = {}
                Config.Timer[k] = 0 -- Default to 0 seconds
                Config[k].Success = 300 -- Default to 30 seconds
                Config[k].Fail = 20 -- Default to 2 seconds
            end
        end
        -- If you want to set specific timers, do it here
        if Config.Shooting then
            Config.Shooting.Success = 150
            Config.Shooting.Fail = 0
        end
            
        notLoaded = nil
    end

This is creating 30 second timers for each alert type when they are sent, and adds a 2 second timer after failing a check; shooting is then being set to be a 15 second delay with no delay after failing to send.

How can I have it enter the coords, info, and street automatically? If you can…

local playerCoords = GetEntityCoords(PlayerPedId())
local street = exports['linden_outlawalert']:getStreetandZone(playerCoords)

Just look at the clientside file to see how to format notification data.

So if I tried putting that into this:

RegisterServerEvent('loffe_robbery:rob')
AddEventHandler('loffe_robbery:rob', function(store)
    local src = source
    Config.Shops[store].robbed = true
    local xPlayers = ESX.GetPlayers()
    for i = 1, #xPlayers do
        local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
        if xPlayer.job.name == 'police' then
            TriggerClientEvent('loffe_robbery:msgPolice', xPlayer.source, store, src)
        end
    end
    TriggerClientEvent('loffe_robbery:rob', -1, store)
    Wait(30000)
    TriggerClientEvent('loffe_robbery:robberyOver', src)

Like this:

RegisterServerEvent('loffe_robbery:rob')
AddEventHandler('loffe_robbery:rob', function(store)
    local src = source
    Config.Shops[store].robbed = true
    local xPlayers = ESX.GetPlayers()
    for i = 1, #xPlayers do
        local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
        if xPlayer.job.name == 'police' then
            TriggerClientEvent('loffe_robbery:msgPolice', xPlayer.source, store, src)
AddEventHandler('esx_JewelRobbery:policenotify', function()
   local playerCoords = GetEntityCoords(PlayerPedId())
local street = exports['linden_outlawalert']:getStreetandZone(playerCoords)
    TriggerEvent('wf-alerts:svNotify', dispatchData)
end)
        end
    end
    TriggerClientEvent('loffe_robbery:rob', -1, store)
    Wait(30000)
    TriggerClientEvent('loffe_robbery:robberyOver', src)

No go :frowning:

i tried also with a atm hacking resource and i cannot get it to work either, any help would be appreciated

Search for while robbing do Wait(0) if IsPedDeadOrDying(peds[i]) then robbing = false end end, should be at line 257.

Above it, add

local street = exports['linden_outlawalert']:getStreetandZone(Config.Shops[i].coords)
local data = {displayCode = '211', description = 'Robbery', isImportant = 0, recipientList = {'police'}, length = '10000', infoM = 'fa-info-circle', info = Config.Shops[i].name}
local dispatchData = {dispatchData = data, caller = 'Alarm', street = street, coords = Config.Shops[i].coords}
TriggerServerEvent('wf-alerts:svNotify', dispatchData)

Update my resource to resolve a bug as well.

You are a god. This pulls everything except the coords for the name of the streets. It says Undefined. But it is pulling the loc for the blip on the big map as well as the store name defined.

You need to update the resource.

Updated. Still nada.