Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SendDistressSignal()
- local alreadyDead = false
- local playerPed = GetPlayerPed(-1)
- local coords = GetEntityCoords(playerPed)
- local PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z }
- while true do
- Citizen.Wait(50)
- if HasEntityClearLosToEntityInFront(player, ped) then
- ESX.ShowNotification(_U('distress_sent'))
- TriggerServerEvent('esx_addons_gcphone:startCall', 'ambulance', _U('distress_message'), PlayerCoords, {
- PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z },
- })
- break
- end
- end
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(50)
- if IsEntityDead(playerPed) and not alreadyDead then
- SendDistressSignal()
- alreadyDead = true
- elseif not IsEntityDead(playerPed) then
- alreadyDead = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement