[FREE] ShotSpotter - Gunshot Detection System

Okay.

Have you tried to restart the script while in game?

If it still doesn’t work, the only thing I can think about is this: go in the client.lua, line 40, and set this 80 in the “Wait” instruction to 0.

Screenshot_20210711-224137_Chrome

Let me know how it goes.

just tried restarting and then modified the client.lua… still nothing

Is there a way to configure it so that only players that are on duty/cops can get the notification, and not players who are being civs? Also will the shotspotter work if AI shoot as well??

1 Like

how do we set it so when a shot in sandy goes off someone in ls don’t get it

In real life, they get all of the shots fired calls (did a ton of research) but dispatch would direct you to the closest call.

Yes its very possible, did it myself (only works if you have LEO group) but it won’t detect upon AI shooting since its ran in a client script which is ran per player

How to modify the script so only police job can see the police alerts? Not the police cars but just people who are the police job? i tried some stuff but im not the best and i don’t know how to do that could someone help?

-- Notify player
RegisterNetEvent('gunshotNotify', function(alert)
		Wait(Config.NotifyTime)
        if xPlayer.job.name == 'police' then
			PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
            Notify(alert)
        end
end)

-- Show blip on map
RegisterNetEvent('gunshotLocation', function(gx, gy, gz)
		Wait(Config.NotifyTime)
        if xPlayer.job.name == 'police' then 
            local gunshotBlip = AddBlipForRadius(gx, gy, gz, Config.BlipRadius)
            SetBlipSprite(gunshotBlip, 161)
            SetBlipColour(gunshotBlip, Config.BlipColor)
            SetBlipAsShortRange(gunshotBlip, 0)
            Wait(Config.BlipTime)
            SetBlipSprite(gunshotBlip, 2)						
        end
end)

I tried this but it doesn’t work sadly

Is this a standalone? I feel that this is a esx base.

I just read the code and its fully standalone.

add esx before xPlayer.job.name == ‘police’ these like this
ESX.xPlayer.job.name == ‘police’ Or without .

Does this script have a radius to notify the police? I’ll shoot and drive a few blocks and never get notified. But I get notified if I shoot and remain relatively close to the area.

how to change so that everyone even outside the car and even a normal citizen can get a notification ?

In the client lua, lines 10 and 19, remove these 2 checks:

if IsPedInAnyPoliceVehicle(PlayerPedId()) then

And also at lines 13 and 26 remove the end

This way every player on the server will get notified.

Thank you and i have another question why the notification is so slow to respond to gunshot ? how to make the notification get respond fast ?

By default it has a delay of 30 seconds because in real life I’d assume the system takes some time to detect the gunshots and send alerts.

However if you wish, you can change this in the config.lua, by changing the Config.NotifyTime variable.

Nice, Thank you so much.

1 Like

@Species8472 Practically @lama-development is saying any vehicle that is under the vehicle class emergency, within the vehicles.meta, since FiveM doesn’t really use flags, anymore, its more now of classes, So instead of Flag_emergency_service, it uses classes, hence the initial (VC - Vehicle Class).

So in this case it would be VC_Emergency, or if you need a service vehicle such as DOT for example, it would be VC_Service.

if you control F and search for VC you should find it there.

Hi! is there anyway to make so that players that have the police job can receive the notifications even tho they are not in any vehicle?

No, since the script is standalone. You would need to edit a bunch of code in order to do that

1 Like

Thank you anyway is spectacular like that

1 Like