Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetCurrentTargetCar()
- local ped = GetPlayerPed(-1)
- local coords = GetEntityCoords(ped)
- local entityWorld = GetOffsetFromEntityInWorldCoords(ped, 0.0, 100.0, 0.0)
- local rayHandle = Citizen.InvokeNative(0x28579D1B8F8AAC80, coords.x, coords.y, coords.z, entityWorld.x, entityWorld.y, entityWorld.z, 5.0, 2, ped, 0)
- local a, b, c, d, vehicleHandle = GetRaycastResult(rayHandle)
- return vehicleHandle
- end
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- -- if ton truc de job then
- if IsControlPressed(1, 244)then
- local pos = GetEntityCoords(GetPlayerPed(-1))
- local coordA = GetEntityCoords(GetPlayerPed(-1), 1)
- local coordB = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0.5, 75.0, 0.0)
- local targetVehicle = GetCurrentTargetCar()
- if targetVehicle ~=nil then
- local plate=GetVehicleNumberPlateText(targetVehicle)
- local herSpeedKm=GetEntitySpeed(targetVehicle)*3.6
- info = string.format("~b~Plaque:~w~ %s ~n~~y~Km/h: ~r~%s",plate,math.ceil(herSpeedKm) )
- DrawRect(0.5,0.0,0.12,0.18,0,10,28,210)
- exports.ft_ui:Text(info, 0, 0, 0.45, 0.01, 0.4, 255, 255, 255, 255)
- end
- end
- -- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment