Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local radarpose=0
- local conepose=0
- local hersepose=0
- -- fonction check voiture radar
- 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, 3.0, 2, ped, 0)
- local a, b, c, d, vehicleHandle = GetRaycastResult(rayHandle)
- return vehicleHandle
- end
- -- vue radar
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if radarpose==1 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)
- -- pose radar
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(1, 244)then
- if radarpose==0 then
- RadarPos = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0, 1.5, 0)
- RadarAng = GetEntityRotation(GetPlayerPed(-1))
- Radar = CreateObject(1927491455, RadarPos.x, RadarPos.y, RadarPos.z - 7, true, true, true) -- http://gtan.codeshock.hu/objects/index.php?page=1&search=prop_cctv_pole_01a
- SetEntityRotation(Radar, RadarAng.x, RadarAng.y, RadarAng.z - 115)
- FreezeEntityPosition(GetPlayerPed(-1), true)
- SetFollowPedCamViewMode(4)
- radarpose=1
- end
- end
- end
- end)
- -- delete radar
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(1, 178)then
- if radarpose==1 then
- DeleteObject(Radar) -- remove the radar pole (otherwise it leaves from inside the ground)
- DeleteEntity(Radar)
- FreezeEntityPosition(GetPlayerPed(-1), false)
- SetFollowPedCamViewMode(0)
- radarpose=0
- end
- end
- end
- end)
- -- creat cone
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(1, 172)then
- if radarpose<25 then
- ConePos = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0, 1.5, 0)
- ConeAng = GetEntityRotation(GetPlayerPed(-1))
- Cone = CreateObject(1839621839, ConePos.x, ConePos.y, ConePos.z - 1, true, true, true) -- http://gtan.codeshock.hu/objects/index.php?page=1&search=prop_cctv_pole_01a
- SetEntityRotation(Cone, ConeAng.x, ConeAng.y, ConeAng.z - 115)
- conepose=conepose+1
- Wait(1000)
- end
- end
- end
- end)
- -- creat herse
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(1, 175)then
- if hersepose==0 then
- hersePos = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0, 1.5, 0)
- herseAng = GetEntityRotation(GetPlayerPed(-1))
- herse = CreateObject(1276148988, hersePos.x, hersePos.y, hersePos.z - 1, true, true, true) -- http://gtan.codeshock.hu/objects/index.php?page=1&search=prop_cctv_pole_01a
- SetEntityRotation(herse, herseAng.x, herseAng.y, herseAng.z)
- hersepose=0
- Wait(1000)
- end
- end
- end
- end)
- -- delete cone
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(1, 173)then
- DeleteObject(Cone)
- DeleteEntity(Cone)
- conepose=0
- end
- end
- end)
- -- test pour voir si vehicule sur herse
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- local carfind = GetClosestVehicle(hersePos.x, hersePos.y, hersePos.z, 2,0,70)
- SetVehicleBurnout(carfind, true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment