[RELEASE] Police ALPR

roleplay
police
radar
alpr

#22

is it possible to use it as KMh ?


#23

Of course you can, just modify the MPH calculation into your KMH calculation, this:

GetEntitySpeed(e)*2.236936

and of course modify the text.


#24

Can you add Kmh to the script? :smiley:


#25

I’m having the issue of it disappearing. It appears and then goes away. Same as @SolarFantom


#26

That might sound stupid, but if you are driving with a controller, ‘numpad5’ is also ‘left dpad down’ (or something else if you changed it)
So it could be that your are moving your car to the left and to the right, and you are tapping it down a little bit that it disappears.
I used this script for 2 Months ( also edited it at little bit :wink: )and I never had problems.

@Brock70
A very simple but good script!


#27

This is really strange, there’s nothing in the code that could cause from my knowledge. I have this resource running on multiple communities with no complaints. Have you tried switching the keys used to see if maybe as Nathro stated it could be control messing it up or something else.


#28

Can someone please list the codes for moving it to the right bottom corner please?


#29

How do I increase the range? Here?


#30

@Brock70 do you think you can give me the location on where you got that mod for showing both mph & kmh?


#31

How do you change the key for enabling it and freezing it?


#32

#33

if IsControlJustPressed(1, 127) and IsPedInAnyPoliceVehicle(GetPlayerPed(-1)) then


#34

Should be as simple as adding another local for it. Look around lines 57-71 for reference

if radar.shown then
if radar.freeze == false then
local veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local coordA = GetOffsetFromEntityInWorldCoords(veh, 0.0, 1.0, 1.0)
local coordB = GetOffsetFromEntityInWorldCoords(veh, 0.0, 105.0, 0.0)
local frontcar = StartShapeTestCapsule(coordA, coordB, 3.0, 10, veh, 7)
local a, b, c, d, e = GetShapeTestResult(frontcar)
if IsEntityAVehicle(e) then
local fmodel = GetDisplayNameFromVehicleModel(GetEntityModel(e))
local fvspeed = GetEntitySpeed(e)*2.236936
local fvkmh = GetEntitySpeed(e)*3.6 -- kmh variable being added
local fplate = GetVehicleNumberPlateText(e)
radar.info = string.format("~y~Plate: ~w~%s ~y~Model: ~w~%s ~y~Speed: ~w~%s mph ~y~/ ~w~%s kmh", fplate, fmodel, math.ceil(fvspeed), math.ceil(fvkmh)) --added kmh
end

Do the same for the rear radar’s code right below (lines 73-85) it and it should display MPH & KMH as well.

Someone let me know if it works, I don’t have a dev environment to test it on myself.


#35

Where can I get a list of the codes for keys?


#36

Here is a list of all the keys and their numerical values

https://wiki.fivem.net/wiki/Controls


#38

How would I go about making it so that I can type a command in the chat box and have it hide the ALPR?
Aswell as changing the color for the text: “model, plate and speed”


#39

Is there a way to get this to recognize add on police vehicles? I have police 2-11 in my city


#40

To combine them, do you use a comma? (i.e. IsControlJustReleased(1, 51, 28)


#41

What are you trying to do? Add it where you press both at the same time?


#42

Yeah. Discovered you just use the ‘and’ keyword