dalammobilpolisi = false terbukaStatus = false frontRadar = true rearRadar = true frontMode = "same" rearMode = "same" rearSpeedLimit = 0 frontSpeedLimit = 0 Display = function(a, force) terbukaStatus = a SendNUIMessage({ type = "Display", bool = terbukaStatus }) if force then SetNuiFocus(false, false) end end if Config.Display.command.active then RegisterCommand(Config.Display.command.name, function() if dalammobilpolisi then Display(not terbukaStatus) end end) end if Config.Display.event.active then RegisterNetEvent(Config.Display.event.name, function() if dalammobilpolisi then Display(not terbukaStatus) end end) end if Config.Display.key.active then RegisterCommand("+toggleradar0Resmon", function() if dalammobilpolisi then Display(not terbukaStatus) end end) RegisterKeyMapping('+toggleradar0Resmon', "Toggle Radar", 'keyboard', Config.Display.key.name) end if Config.Display.cursor.command.active then RegisterCommand(Config.Display.cursor.command.name, function() if terbukaStatus then SetNuiFocus(true, true) end end) end RegisterNUICallback("setSpeedLimit", function(data, cb) if data.type == "rear" then rearSpeedLimit = tonumber(data.limit) end if data.type == "front" then frontSpeedLimit = tonumber(data.limit) end end) -- Cursor RegisterNUICallback("setType", function(data, cb) if data.yon == "rear" then rearMode = data.type end if data.yon == "front" then frontMode = data.type end end) RegisterNUICallback("closeCursor", function(data, cb) SetNuiFocus(false,false) end) Citizen.CreateThread(function() while true do if terbukaStatus then Citizen.Wait(500) if Config.Display.cursor.key.active then local key1Pressed = false local key2Pressed = false if Config.Display.cursor.key.key1 then key1Pressed = IsControlPressed(0, Config.Display.cursor.key.key1) end if Config.Display.cursor.key.key2 ~= false then key2Pressed = IsControlJustPressed(0, Config.Display.cursor.key.key2) end if key1Pressed and (key2Pressed or Config.Display.cursor.key.key2 == false) then if terbukaStatus then SetNuiFocus(true, true) end end end else Citizen.Wait(3000) end end end) -- Araba kontrolü Citizen.CreateThread(function() while true do Wait(2000) local berkelas = GetVehicleClass(GetVehiclePedIsIn(PlayerPedId())) dalammobilpolisi = berkelas == 18 and true or false if not dalammobilpolisi and terbukaStatus then Display(false, true) end end end) function gettamsayi(num) return tonumber(string.format("%.0f", num)) end function GetVehicleInDirectionSphere(entFrom, coordFrom, coordTo) local rayHandle = CastRayPointToPoint(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, entFrom, 0) local _, _, _, _, vehicle = GetShapeTestResult(rayHandle) return vehicle end function oppang(ang) return (ang + 180) % 360 end aci = { ["same"] = vector3(0.0, 50.0, 0.0), ["opp"] = vector3(-10.0, 50.0, 0.0) } Citizen.CreateThread(function() while true do if terbukaStatus then local vehicle = GetVehiclePedIsIn(PlayerPedId()) if DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == PlayerPedId() then local vehicleSpeed = GetEntitySpeed(vehicle) * 3.6 SendNUIMessage({ type = "updateRadar", myspeed = vehicleSpeed }) local vehiclePos = GetEntityCoords(vehicle, true) local h = gettamsayi(GetEntityHeading(vehicle), 0) if frontRadar then local forwardPosition = GetOffsetFromEntityInWorldCoords(vehicle, aci[frontMode]) local fwdPos = { x = forwardPosition.x, y = forwardPosition.y, z = forwardPosition.z } local _, fwdZ = GetGroundZFor_3dCoord(fwdPos.x, fwdPos.y, fwdPos.z + 500.0) if fwdPos.z < fwdZ and not (fwdZ > vehiclePos.z + 1.0) then fwdPos.z = fwdZ + 0.5 end local fwdVeh = GetVehicleInDirectionSphere(vehicle, vehiclePos, fwdPos) if DoesEntityExist(fwdVeh) and IsEntityAVehicle(fwdVeh) then local fwdVehSpeed = gettamsayi(GetEntitySpeed(fwdVeh) * 3.6, 0) local fwdVehHeading = GetEntityHeading(fwdVeh) local plate = GetVehicleNumberPlateText(fwdVeh) currentFrontVehicle = fwdVeh local speed = frontLockedSpeed or fwdVehSpeed SendNUIMessage({ type = "updateRadar", frontplate = plate, frontspeed = speed }) if frontSpeedLimit > 0 and frontSpeedLimit and speed > frontSpeedLimit then PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 ) end end end if rearRadar then local backwardPosition = GetOffsetFromEntityInWorldCoords(vehicle, aci[rearMode].x, -aci[rearMode].y, aci[rearMode].z) local bwdPos = { x = backwardPosition.x, y = backwardPosition.y, z = backwardPosition.z } local _, bwdZ = GetGroundZFor_3dCoord(bwdPos.x, bwdPos.y, bwdPos.z + 500.0) if bwdPos.z < bwdZ and not (bwdZ > vehiclePos.z + 1.0) then bwdPos.z = bwdZ + 0.5 end local bwdVeh = GetVehicleInDirectionSphere(vehicle, vehiclePos, bwdPos) if DoesEntityExist(bwdVeh) and IsEntityAVehicle(bwdVeh) then local bwdVehSpeed = gettamsayi(GetEntitySpeed(bwdVeh) * 3.6, 0) local bwdVehHeading = GetEntityHeading(bwdVeh) local plate = GetVehicleNumberPlateText(bwdVeh) currentRearVehicle = bwdVeh local speed = bwdVehSpeed SendNUIMessage({ type = "updateRadar", rearplate = plate, rearspeed = speed }) if rearSpeedLimit > 0 and rearSpeedLimit and speed > rearSpeedLimit then PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 ) end end end end Wait(200) else Citizen.Wait(3000) end end end) RegisterNUICallback("close", function() Display(false, true) end)