[FREE] Police MDT - (ND_Core)

Hi everyone, I wanted to give an update as I use this script a lot and I’m trying to implement as many features as possible to make it top-notch. One essential thing that’s still missing is the ability to delete calls so the list doesn’t get cluttered. Below is what needs to be added [ESX VERSION] to enable call deletion:

:one: translate.json
Add the following entry:
"Delete Call": "Delete Call",

:two: script.js
After the rightPanelDashboard911CallsItemRespond section, insert:

${call.isCancellata && `
    <br><br> 
    <button class="rightPanelDashboard911CallsItemCancella" data-call="${call.callId}" style="background-color: rgb(201, 38, 38);">
        ${translation["Detach from call"]} [${translation["call id"]}: ${call.callId}]
    </button>
` || `
    <br><br> 
    <button class="rightPanelDashboard911CallsItemCancella" data-call="${call.callId}">
        ${translation["Delete Call"]} [${translation["call id"]}: ${call.callId}]
    </button>
`}

:three: style.css
Add the following style:

.rightPanelDashboard911CallsItemCancella {
    width: auto;
    height: 2.4vh;
    padding: 8px;
    text-align: center;
    line-height: 0;
    font-weight: bolder;
    color: #ffffff;
    background-color: #960000;
    border-radius: 5px;
    border: none;
    transition: .1s ease-in-out;
}
.rightPanelDashboard911CallsItemCancella:hover {
    transition: .1s ease-in-out;
    cursor: pointer;
    color: rgb(255, 255, 255);
    opacity: 0.7;
}

:four: client.lua
Add this callback to handle deletion:

RegisterNUICallback("cancellaChiamata", function(data)
    PlaySoundFrontend(-1, "PIN_BUTTON", "ATM_SOUNDS", 1)
    TriggerServerEvent("ND_MDT:cancellaChiamata", tonumber(data.id))
end)

:five: server.lua
Register the server event to remove the call:

RegisterNetEvent("ND_MDT:cancellaChiamata", function(call)
    local src = source
    local player = Bridge.getPlayerInfo(src)
    if not config.policeAccess[player.job] and not config.fireAccess[player.job] then return end

    if not emeregencyCalls[call] then return end

    emeregencyCalls[call] = nil

    TriggerClientEvent("ND_MDT:update911Calls", -1, emeregencyCalls, {
        type = "delete",
        call = call
    })
end)

Soon I’ll also be releasing a super simple police GPS script (just need to set up my Tebex account). It includes an item and automatically creates map blips that increase incrementally and change names based on the job – so you’ll see stuff like ADAM-1, ADAM-2, UNIT-1, UNIT-2, etc.

You can turn it on/off manually, and if the GPS item gets removed from your inventory, it shuts off automatically.

It’s the first script I’m releasing to the public, and I was thinking of pricing it around $10–15. Do you think that’s too much? I’m not making it free just because I’d like to make a little extra on the side.

1 Like

please get official support to ESX

Hello, works with qb? :slight_smile:

please can you make it QB

I’d really like to test this out as it seems like a system thats perfect for ehat we need. We have an esx server and after a lot of work on it, I’m reluctant on switching to an entirety new framework just to use this MDT.

Is there a way I can add this to an esx server without entirely changing the framework?