GithubHelp home page GithubHelp logo

nicolas-garcia / linden_outlawalert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thelindat/linden_outlawalert

0.0 0.0 0.0 916 KB

Display notifications for any job, with automated checks for shooting, carjacking, speeding, and more.

Home Page: https://forum.cfx.re/t/esx-outlawalert-wildfire-alerts-and-hypaste-mdt-integration/2067483

License: MIT License

Lua 81.48% HTML 1.49% JavaScript 8.69% CSS 8.34%

linden_outlawalert's Introduction


* Intended for use with [ESX] Hypaste RP’s Mobile Data Terminal by distritic, but it is not required *


For more support or to see more of my resources you can join my discord

Buy Me A Coffee

Instructions

Download either the latest release or the latest repo. Just drag and drop.
Ensure you set Config.Debug to false so cops don't trigger a bunch of warnings, and to disable debug information printing into the console.
If you want 100% report chance then leave Config.DebugChance, though I recommend disabling it.
Share any feedback on the thread

Optional

Download my Hypaste mdt fork or modify the original release (read below).

Hypaste mdt original git
Open mdt/sv_mdt.lua and locate RegisterServerEvent("mdt:newCall"), replace with:

RegisterServerEvent("mdt:newCall")
AddEventHandler("mdt:newCall", function(details, caller, coords, sendNotification)
call_index = call_index + 1
local xPlayers = ESX.GetPlayers()
for i= 1, #xPlayers do
	local source = xPlayers[i]
	local xPlayer = ESX.GetPlayerFromId(source)
	if xPlayer.job.name == 'police' then
  	if sendNotification ~= false then
  		TriggerClientEvent("InteractSound_CL:PlayOnOne", source, 'demo', 1.0)
  		TriggerClientEvent("mythic_notify:client:SendAlert", source, {type="inform", text="You have received a new call.", 5000, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' }})
  	end
		TriggerClientEvent("mdt:newCall", source, details, caller, coords, call_index)
	end
end
end)

Custom alerts

Check the https://github.com/thelindat/linden_outlawalert/wiki for existing examples.
For example, if we were to edit one of the jewelry heist scripts, you can replace the default method for alerting the police with the following

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', coords = vector3(-633.9, -241.7, 38.1)}
TriggerEvent('wf-alerts:svNotify', dispatchData)

You can define infoM2 and info2 for an additional line of text. If you are triggering the event from a client make sure you use TriggerServerEvent.

You can use the below code to use the report chance export. Setting the last number higher will reduce the likelihood of a notification being sent.

if exports['linden_outlawalert']:zoneChance('Custom', 2) then
	do stuff
end

gcphone 911 support

Locate function notifyAlertSMS in esxaddonsgcphone-s.lua. Below local messText = alert.message add

    if number == 'police' or number == 'ambulance' then
      TriggerEvent('wf-alerts:svNotify911', messText, alert.numero, GetEntityCoords(GetPlayerPed(alert.source)))
    end

Credits:

Jager_bom for esx_outlawalert
Stroudy for WF_Alerts https://forum.cfx.re/t/dev-release-standalone-wf-alerts/1029331
distritic for Hypaste RP's MDT https://forum.cfx.re/t/esx-hypaste-rps-mobile-data-terminal-reports-warrants-calls-searches-more/1701472/1

linden_outlawalert's People

Contributors

thelindat avatar henkoe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.