is it possible to use it as KMh ?
Of course you can, just modify the MPH calculation into your KMH calculation, this:
GetEntitySpeed(e)*2.236936
and of course modify the text.
Can you add Kmh to the script?
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 )and I never had problems.
@Brock70
A very simple but good script!
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.
Can someone please list the codes for moving it to the right bottom corner please?
@Brock70 do you think you can give me the location on where you got that mod for showing both mph & kmh?
How do you change the key for enabling it and freezing it?
if IsControlJustPressed(1, 127) and IsPedInAnyPoliceVehicle(GetPlayerPed(-1)) then
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.
Where can I get a list of the codes for keys?
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â
Is there a way to get this to recognize add on police vehicles? I have police 2-11 in my city
To combine them, do you use a comma? (i.e. IsControlJustReleased(1, 51, 28)
What are you trying to do? Add it where you press both at the same time?
Yeah. Discovered you just use the âandâ keyword