RegisterNetEvent("gps:ems")
AddEventHandler("gps:ems", function()
if ESX.PlayerData.job and ESX.PlayerData.job.name == 'ambulance' then
SetNewWaypoint(emsalertslc.x, emsalertslc.y)
exports["mythic_notify"]:SendAlert("inform", "Olay yeri haritada işaretlendi.")
else
exports["mythic_notify"]:SendAlert("error", "Doktor kodunu doktor olmadan kullanamazsın..")
end
end)
ilk bu satırı
ondan sonra bu satırı
function SendDistressSignalPolice()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local playerCoords = GetEntityCoords(playerPed)
local currentVehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local plyPos = GetEntityCoords(GetPlayerPed(-1))
local s1, s2 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, plyPos.x, plyPos.y, plyPos.z, Citizen.PointerValueInt(), Citizen.PointerValueInt() )
local street1 = GetStreetNameFromHashKey(s1)
zone = tostring(GetNameOfZone(plyPos.x, plyPos.y, plyPos.z))
local playerStreetsLocation = zoneNames[tostring(zone)]
local street1 = street1 .. ", " .. playerStreetsLocation
local street2 = GetStreetNameFromHashKey(s2)
local adres = street1.. " " .. street2
DecorSetInt(playerPed, 'isOutlaw', 2)
TriggerServerEvent('esx_outlawalert:ambulanceecodea', {
x = ESX.Math.Round(playerCoords.x, 1),
y = ESX.Math.Round(playerCoords.y, 1),
z = ESX.Math.Round(playerCoords.z, 1)
}, adres, playerGender)
exports['mythic_notify']:SendAlert('inform', "Yardım çağırdın EMS, Sheriff ve LSPD ekiplerine gönderildi, dayan!")
TriggerServerEvent('esx_phone:send', 'ambulance', 'Yaralı kişi , acil ambulans gerekiyor' , false, {
x = coords.x,
y = coords.y,
z = coords.z
})
RegisterNetEvent('esx_outlawalert:outlawNotifyEMS')
AddEventHandler('esx_outlawalert:outlawNotifyEMS', function(type, data, length)
if ESX.PlayerData.job and ESX.PlayerData.job.name == 'ambulance' then
SendNUIMessage({action = 'display', style = type, info = data, length = length})
PlaySound(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 0, 0, 1)
end
end)
ondan sonra bunu
RegisterNetEvent('esx_outlawalert:emsalerts')
AddEventHandler('esx_outlawalert:emsalerts', function(targetCoords)
if ESX.PlayerData.job and ESX.PlayerData.job.name == 'ambulance' then
local alpha = 250
local emsBlip = AddBlipForRadius(targetCoords.x, targetCoords.y, targetCoords.z, 50000)
emsalertslc = targetCoords
SetBlipHighDetail(emsBlip, true)
SetBlipColour(emsBlip, 5)
SetBlipAlpha(emsBlip, alpha)
SetBlipAsShortRange(emsBlip, true)
while alpha ~= 0 do
Citizen.Wait(Config.PoliceCodeTime * 4)
alpha = alpha - 1
SetBlipAlpha(emsBlip, alpha)
if alpha == 0 then
RemoveBlip(emsBlip)
return
end
if IsControlPressed(0, 38) then
SetNewWaypoint(targetCoords.x, targetCoords.y, targetCoords.z)
PlaySoundFrontend(-1, "WAYPOINT_SET", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0)
end
end
end
end)
en sonda bunu
AddEventHandler('rpv:emsalerts', function()
local playerPed = PlayerPedId()
local playerCoords = GetEntityCoords(playerPed)
local currentVehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local plyPos = GetEntityCoords(GetPlayerPed(-1))
local s1, s2 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, plyPos.x, plyPos.y, plyPos.z, Citizen.PointerValueInt(), Citizen.PointerValueInt() )
local street1 = GetStreetNameFromHashKey(s1)
zone = tostring(GetNameOfZone(plyPos.x, plyPos.y, plyPos.z))
local playerStreetsLocation = zoneNames[tostring(zone)]
local street1 = street1 .. " | " .. playerStreetsLocation
local street2 = GetStreetNameFromHashKey(s2)
local adres = street1.. " " .. street2
--local gps
--gps = math.random(100, 999)
TriggerServerEvent('esx_outlawalert:emsalerts', {
x = ESX.Math.Round(playerCoords.x, 1),
y = ESX.Math.Round(playerCoords.y, 1),
z = ESX.Math.Round(playerCoords.z, 1)
}, adres, playerGender)
end)