[Release][YMAP][ESX] Police Training Facility V2

I still unable to find the problem. And yet the consol giving a ‘all good’ signal with no error at all

	--
	-- Bolingbroke Penitentiary
	--

	-- Entrance (Two big gates)
	{
		objName = 'prop_gate_prison_01',
		objCoords  = vector3(1844.9, 2604.8, 44.6),
		textCoords = vector3(1844.9, 2608.5, 48.0),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 12,
		size = 2
	},

	{
		objName = 'prop_gate_prison_01',
		objCoords  = vector3(1818.5, 2604.8, 44.6),
		textCoords = vector3(1818.5, 2608.4, 48.0),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 12,
		size = 2
	},

	-- Fort Zancudo Great Ocean Hwy Entrance
	{
		objName = 'prop_gate_airport_01',
		objCoords  = {x = -2323.39, y = 3393.71, z = 30.0},
		textCoords = {x = -2319.81, y = 3399.76, z = 32.72},
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	{
		objName = 'prop_gate_airport_01',
		objCoords  = {x = -2315.04, y = 3404.96, z = 30.0},
		textCoords = {x = -2319.81, y = 3399.76, z = 32.72},
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	-- Fort Zancudo Route 68 Entrance
	{
		objName = 'prop_gate_airport_01',
		objCoords  = {x = -1571.79, y = 2785.86, z = 17.0},
		textCoords = {x = -1576.25, y = 2780.15, z = 18.5},
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	{
		objName = 'prop_gate_airport_01',
		objCoords  = {x = -1581.76, y = 2775.67, z = 17.0},
		textCoords = {x = -1576.25, y = 2780.15, z = 18.5},
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},
	--
	-- Addons
	--

@Chip_W_Gaming @alan245
Change the New lines with the following:

	-- Fort Zancudo Great Ocean Hwy Entrance
	{
		objName = 'prop_gate_airport_01',
		objCoords  = vector3(-2323.39, 3393.71, 30.0),
		textCoords = vector3(-2319.81, 3399.76, 32.72),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	{
		objName = 'prop_gate_airport_01',
		objCoords  = vector3(-2315.04, 3404.96, 30.0),
		textCoords = vector3(-2319.81, 3399.76, 32.72),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	-- Fort Zancudo Route 68 Entrance
	{
		objName = 'prop_gate_airport_01',
		objCoords  = vector3(-1571.79, 2785.86, 17.0),
		textCoords = vector3(-1576.25, 2780.15, 18.5),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

	{
		objName = 'prop_gate_airport_01',
		objCoords  = vector3(-1581.76, 2775.67, 17.0),
		textCoords = vector3(-1576.25, 2780.15, 18.5),
		authorizedJobs = { 'police' },
		locked = true,
		distance = 14,
		size = 2
	},

Fixed. Thank you very much

1 Like

Except that mine works perfect. I don’t need to change it. Not sure why it would be different for anyone else.

Nice script!
But i shoot on the Panel but they do not give me points, i got 0 Points.
any know why?
Thanks

Is it posible to make this non esx?

No. All the things used to enhance the role play are ESX based. You can use version 1 which is just two ymaps with static targets and located at LSIA. The cones don’t move and will wreck a car.

Have the same since I’m using OneSync 64 slots. And the same with esx_gunrange. Works perfectly with 32 slots but no more on 64 slots + holograms text are blinking…

everything works, but no score and no popup targets… and when i walk to the gunrange and press E, nothing happens

I didn’t create either of those scripts. Only added text and change gun range locations. I gave links to the original creators, you can get support from them.

1 Like

esx_gunrange targets pop up but score does not update at all. anyone know how to fix this?

Same issue (using OneSync)

I cant get the map to work, or the gun ranges :confused: Thanks for the effort anyways, Ill be looking for something else for the police training

Hello, for me the game launches but the targets ignore shots and the points do not add up, some solution?

For anyone having issues with the gun ranges not working with the points system, I managed to get mine working through some troubleshooting. I found that this line under client\main.lua was never being triggered:

if HasEntityBeenDamagedByEntity(target,GetPlayerPed(-1),1) then
--do stuff
end

So I tried different “HasEntityBeenDamaged…” variants and found that the reference “HasEntityBeenDamagedByAnyPed” actually works. Of course, this doesn’t account for if another player decides to shoot/damage the target while you’re active on the range however it will work for my situation.

So to fix it, open up the client\main.lua file in both esx_gunrange and esx_gunrange2 and find the line mentioned above (around line 42) and replace it with:

if HasEntityBeenDamagedByAnyPed(target) then
--do stuff
end

I also added a 100ms wait before the target is deleted so it doesn’t immediately disappear on shot. If you want to add this too, look for this line (around line 54):

DeleteObject(target)

and add this above it (after the end statement):

Citizen.Wait(100)

It should look something like this altogether:

		if target ~= nil then
			if HasEntityBeenDamagedByAnyPed(target) then
				if HasBulletImpactedInBox(cTCoords[1]+0.06,cTCoords[2]+0.12,cTCoords[3]+0.46,  cTCoords[1]-0.06,cTCoords[2],cTCoords[3]+0.6,true,true) then
					points = points + 5
				elseif HasBulletImpactedInBox(cTCoords[1]+0.11,cTCoords[2]+0.12,cTCoords[3]+0.41,  cTCoords[1]-0.11,cTCoords[2],cTCoords[3]+0.69,true,true) then
					points = points + 4
				elseif HasBulletImpactedInBox(cTCoords[1]+0.16,cTCoords[2]+0.12,cTCoords[3]+0.33,  cTCoords[1]-0.16,cTCoords[2],cTCoords[3]+0.76,true,true) then
					points = points + 3
				elseif HasBulletImpactedInBox(cTCoords[1]+0.21,cTCoords[2]+0.12,cTCoords[3]+0.25,  cTCoords[1]-0.21,cTCoords[2],cTCoords[3]+0.85,true,true) then
					points = points + 2
				else
					points = points + 1
				end
					Citizen.Wait(100)
					DeleteObject(target)
					target = nil
					cTCoords = {}
			end
		end

Once the modifications have been made, restart your gunrange resources and test it out. Hopefully this helps someone :slight_smile:

1 Like

hi can any1 help me please with this script on the gunrage cant seem to get the points system to work Thanks

For some reason the point system isn’t working for me :frowning: