[ESX] Detector / Detect if you have weapons

Oh well, I turned on the marker and it does not show up or work. No errors in console, it says it is started, but appears to not be loading. One last question. If I get this working, is there a way to get the actual detector machine at the pd?

I have the script in my ESX folder. If that matters.

Hey mate,

I got working with the coordinates, I can see the marker and everything. When a normal player goes through it with a weapon it tells them on the bottom center of the screen “You had a weapon on you, the police have been informed” but it dosen’t make a sound? Any fix?

Make sure you put InteractSound folder into your resources and start InteractSound into server config…

Ihave testing the source and it all work perfect if you do it right

I need the ogg sound file though, how do I get that?

it is inside the InteractSound file inside the download

1 Like

Thanks for helping him, like he says the file is in the folder.

Thanks GigaBytesGTA :wink:

Is there a way to replace the .ogg file with another sound?
Do I just replace the sound that is in the sounds file or?

Yes, just change the .ogg file with the same name.

Hi, great script, I have a problem when I pass the detector as a civilian he says Someone walked through the sensor and had a weapon while I am not a policeman
with the option of pressing [e] to have a mark on the map
How to remove this message for civilians.

remove triggerevent(‘esx_phone:send’) something

Whenever someone goes through the detector, it gives the alert to police, but when you press e to take the call the mark on the map is in some random location, Not at Mission Row for instance

You need to change the coords in the event esx:phone:send


			Wait(5000)
			--sends message to police
			TriggerServerEvent('esx_phone:send', 'police', _U('police_message'), true, {}, true)

This is what it looks like in my main.lua config I dont see it anywhere else

Could you help me, please?
When the player passes through the PD door he is informed that he is armed and the police will be informed
Plus my cops are not getting the notification

I need help please i dont now way this happen ?’’

Try download new version of it. Link in original post.

the new one dont work i using the one you post in comments that work the sound

1 Like

i think you dint update good the link

1 Like

I have fps problem after the extended and esentialmode update, does anyone have a fix?

hello can we add the sheriff and the Fbi please

if HasPedGotWeapon(playerPed, weaponHash, false) then
if CurrentAction == ‘detector’ then
–nothings happens if police
if PlayerData.job ~= nil and PlayerData.job.name == ‘police’ then
–
else
if PlayerData.job ~= nil and PlayerData.job.name == ‘sheriff’ then
–
else

		--prints name and weapon in client
		print(Config.Weapons[i].name .. ' - ' .. GetPlayerName(id))
		--sends message to client
		sendNotification(_U('busted'), 'error', 5000)
		--makes sound to everyone around him
		TriggerServerEvent("InteractSound_SV:PlayWithinDistance", 55, "detector", 1.0)

		Wait(5000)
		--sends message to police
		TriggerServerEvent('esx_phone:send', 'police', _U('police_message'), true, {}, true)
		TriggerServerEvent('esx_phone:send', 'sheriff', _U('sheriff_message'), true, {}, true)
	 end
    end