LH_Lawliet

Untitled

Jul 13th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. function GetCurrentTargetCar()
  2.     local ped = GetPlayerPed(-1)
  3.     local coords = GetEntityCoords(ped)
  4.    
  5.     local entityWorld = GetOffsetFromEntityInWorldCoords(ped, 0.0, 100.0, 0.0)
  6.     local rayHandle = Citizen.InvokeNative(0x28579D1B8F8AAC80, coords.x, coords.y, coords.z, entityWorld.x, entityWorld.y, entityWorld.z, 5.0, 2, ped, 0)
  7.     local a, b, c, d, vehicleHandle = GetRaycastResult(rayHandle)
  8.  
  9.     return vehicleHandle
  10. end
  11.  
  12. Citizen.CreateThread(function()
  13.     while true do
  14.         Wait(0)
  15.         --  if   ton truc de job    then
  16.               if IsControlPressed(1, 244)then
  17.                 local pos = GetEntityCoords(GetPlayerPed(-1))
  18.                 local coordA = GetEntityCoords(GetPlayerPed(-1), 1)
  19.                 local coordB = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0.5, 75.0, 0.0)
  20.                 local targetVehicle = GetCurrentTargetCar()            
  21.                  if targetVehicle ~=nil then
  22.                      local plate=GetVehicleNumberPlateText(targetVehicle)
  23.                      local herSpeedKm=GetEntitySpeed(targetVehicle)*3.6
  24.                      info = string.format("~b~Plaque:~w~ %s ~n~~y~Km/h:  ~r~%s",plate,math.ceil(herSpeedKm) )
  25.                     DrawRect(0.5,0.0,0.12,0.18,0,10,28,210)
  26.                     exports.ft_ui:Text(info, 0, 0, 0.45, 0.01, 0.4, 255, 255, 255, 255)
  27.                  end
  28.            
  29.               end
  30.         -- end
  31.      end  
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment