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

This resource is not supported.


Send a WildFire alert to any job of your choice. Auto detection for shooting, drive-by shooting, speeding, carjacking, and officers dying. If you are using Hypaste MDT it will save the information for future viewing in the mdt.

Read the instructions on github to prevent the default mdt:newCall notification from being triggered alongside these.

Credits:
@Jager_Bom for esx_outlawalert
@Stroudy for WF_Alerts
@distritic for mdt

Information
There is only a chance for crimes to be reported based on your location and the time of day (can be set to 100% in config), but I cannot be certain how appropriate the numbers are - feedback is appreciated.
Included /911 and /911a commands; you can use either the player name or phone number as the caller.

24 Likes

Was just looking through this now and this is better than I could ever think of, well played with the usage of the alerts! also loving the integration in Hypaste MDT, totally did not expect that - 10/10 for actually using a dev resource and improving it to your own image, also looked at the script and it looks well done.

Bravo.

3 Likes

Thats awesome.
but on your mdt fork you deleted a lot of code from the serverfile as a mistake.

also about the identifier you added its “steam”
can it also be used for “licencse” for people which use v1final with the rockstar license?

1 Like

I’m actually not sure how I managed to mess that up haha - serverfile is fixed for my fork of mdt.

I’m using ‘xPlayer.identifier’ to get the player identifier so it should be getting whatever your ESX is storing in the playerdata. Try replacing the ServerCallback with:

ESX.RegisterServerCallback('mdt_outlawalert:getCharData', function(source, cb)
	local xPlayer = ESX.GetPlayerFromId(source)
	if not xPlayer then return end

	local PrimaryIdentifier = 'license'
	for k,v in ipairs(GetPlayerIdentifiers(source)) do
        if string.match(v, PrimaryIdentifier) then
            local identifier = v
            MySQL.Async.fetchAll('SELECT firstname, lastname, phone_number FROM users WHERE identifier = @identifier', {
				['@identifier'] = identifier
			}, function(results)
				cb(results[1])
			end)
        end
    end
end)
3 Likes

Thanks sharing, looks awesome.

This happens on 2560 × 1440 and I assume other resolutions aswell in case you’re not aware of it.

1 Like

I’ve updated the css if you could test it for me (only running 1920 x 1080).

2 Likes

Now it’s perfect. :slight_smile:

2 Likes

Is it possible to adjust the height of the notification based on the description lenght? I wanna use this notification for /911 and /911a aswell.

I’ve noticed altering $notification.height on the main.js does the job but I’m not sure how to make it based on the lenght of the message instead of fixed.

Any help or guidance is greatly appreciated.

2 Likes

have you considered using the wf_alerts v2? that way the alert could go red for specific alerts, mechanics could be integrated into it and ems?

1 Like

I’ll write something up later today, but basically you need to send data to mdt:newCalls. If you look at /911(a) and the automated outlaw alerts it sends an extra variable.

local data = {['code'] = '10-71b', ['name'] = 'Drive-by shooting', ['style'] = 'police', ['desc'] = ('[%s] %s %s'):format(plate, vehicleDoors, vehicleClass), ['netid'] = netid, ['loc'] = playerCoords, ['length'] = '8000', ['caller'] = 'Local'}
                                TriggerServerEvent('mdt:newCall', data.name, data.caller, vector3(data.loc.x, data.loc.y, data.loc.z), data)

vs

TriggerServerEvent('mdt:newCall', args, "Unknown", vector3(playerCoords.x, playerCoords.y, playerCoords.z))

Honestly there’s a few things I want to change around right now with the code since it’s a bit messy and I put in band-aid patches.

2 Likes

I actually started working on parts of this around a year ago, just building off of the other outlawalert script. Though there isn’t any support outside of policejob (I’ll look into it though), you can change the appearance of the alert.

Most of the alerts use ['style'] = 'police' for the typical blue, but you can use ['style'] = 'officer-down' for a blue/red flash. Just go into style.css and make a style similar to below

.police {
    box-shadow: -3px 0px 0px 0px rgba(47, 110, 182, 0.9) inset;
    background: rgba(26, 68, 116, 0.9);
}

.officer-down {
    box-shadow: -3px 0px 0px 0px rgba(47, 110, 182, 0.9) inset;
    background: rgba(26, 68, 116, 0.9);
    animation: myfirst 5s linear 0s infinite alternate;
}

@keyframes myfirst {
    0%   {background-color:rgba(173, 38, 38, 0.9); left:0px; top:0px;}
    15%  {background-color:rgba(30, 79, 134, 0.9); left:200px; top:200px;}
    30% {background-color:rgba(173, 38, 38, 0.9); left:0px; top:0px;}
    45%  {background-color:rgba(30, 79, 134, 0.9); left:200px; top:200px;}
    60% {background-color:rgba(173, 38, 38, 0.9); left:0px; top:0px;}
    75%  {background-color:rgba(30, 79, 134, 0.9); left:200px; top:200px;}
    90% {background-color:rgba(173, 38, 38, 0.9); left:0px; top:0px;}
    100%  {background-color:rgba(30, 79, 134, 0.9); left:200px; top:200px;}
  }

There’s still leftover styles not being used in there as well.

1 Like

I’ll be putting the latest code up in a moment as 2.0.1

2 Likes

Awesome, thank you. I managed to kinda get what I was looking for using desc2 only for calls and making that notification a bit higher so it has room for a long message. Still height is not variable according to the lenght of the message but it’s good enough for now. Thanks for taking your time to explain and for the update. <3

1 Like

Hey there, I would like to take the time from myself and my officers to thank you for putting this together they love it, sooooo much better then any notification script so far, I am curious if you could help me with making it we receive callouts and/or alerts from drug dealing, what ive done so far is ive created my code for the call but i dont understand where to put the second part of code

1 Like

Depends what drugsale script you’re using, but if for example you have the event
TriggerServerEvent(‘np_selltonpc:saleInProgress’, streetName) being triggered from clientside, you can modify the serverside event to

RegisterServerEvent('np_selltonpc:saleInProgress')
AddEventHandler('np_selltonpc:saleInProgress', function(streetName, playerGender)
	if playerGender == 0 then
		playerGender = 'Female'
	else
		playerGender = 'Male'
	end

    local data = {displayCode = '6969', description = 'Drug sale in progress', isImportant = 0, recipientList = {'police'}, length = '5000', infoM = 'fa-info-circle', info = ('A %s has been reported selling drugs'):format(playerGender)}
    local dispatchData = {dispatchData = data, caller = 'Local', street = streetName, coords = GetEntityCoords(GetPlayerPed(source))}
    TriggerEvent('wf-alerts:svNotify', dispatchData)
end)

Untested.

1 Like

lol best part is you used the example of the exact script im using, thanks, ill throw it in and give it a test. Keep up the great work and great support!

1 Like

I dont know if im the only one, but i can’t add new notifications in the script. Im not getting any error, but it won’t show me the new alerts I added myself. Anybody has the same problem?

1 Like

If you’re sending the notification from client, make sure you are using TriggerServerEvent(‘wf-alerts:svNotify’, dispatchData)

1 Like

The shooting alerts arent working for me, did I do something wrong? All the other ones and my custom ones do, just not shooting.

1 Like

Nah, I’m just a potato and moved the shooting check into the wrong spot. Fixed.

1 Like