Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. local caller
  2. local callerPos
  3.  
  4. local emergencycall=0
  5.  
  6. CreateThread(function()
  7. while true do
  8. Wait(0)
  9. if(emergencycall==1) then
  10. if IsGameKeyboardKeyJustPressed(79) then
  11. emergencycall=0
  12. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Contacting the Police department...")
  13. Wait(5000)
  14. caller = GetPlayerPed()
  15. callerPos = table.pack(GetCharCoordinates(caller, _f, _f, _f))
  16. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1The Police department dispatched units to your current location...")
  17. Wait(2000)
  18. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...(call ended)")
  19. TriggerServerEvent('911callPolice')
  20. end
  21. if IsGameKeyboardKeyJustPressed(80) then
  22. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Contacting EMS services...")
  23. emergencycall=0
  24. Wait(5000)
  25. caller = GetPlayerPed()
  26. callerPos = table.pack(GetCharCoordinates(caller, _f, _f, _f))
  27. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1EMS dispatched units to your current location...")
  28. Wait(2000)
  29. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...(call ended)")
  30. TriggerServerEvent('911callEMS')
  31. end
  32. if IsGameKeyboardKeyJustPressed(81) then
  33. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Contacting the Fire department...")
  34. emergencycall=0
  35. Wait(5000)
  36. caller = GetPlayerPed()
  37. callerPos = table.pack(GetCharCoordinates(caller, _f, _f, _f))
  38. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1The Fire department dispatched units to your current location...")
  39. Wait(2000)
  40. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...(call ended)")
  41. TriggerServerEvent('911callFire')
  42. end
  43. end
  44. end
  45. end)
  46.  
  47. AddEventHandler('911Call', function()
  48. CreateThread(function()
  49. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1911, What's your emergency?...")
  50. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Dial 1 ^5(NumPad1) ^1to contact the Police department...")
  51. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Dial 2 ^5(NumPad2) ^1to contact EMS services...")
  52. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Dial 3 ^5(NumPad3) ^1to contact the Fire department.")
  53. emergencycall=1
  54. Wait(15000)
  55. if(emergencycall==1) then TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Sir, are you still on the line?...")
  56. else return
  57. end
  58. Wait(15000)
  59. if(emergencycall==1) then TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...Sorry, someone else might need the line...")
  60. else return
  61. end
  62. TriggerEvent('chatMessage', '911', { 0, 0x99, 255 }, "^1...(call ended)")
  63. emergencycall=0
  64. end)
  65. end)
  66.  
  67. AddEventHandler('911callPolice', function()
  68. if(IsCharModel(GetPlayerPed(), GetHashKey("M_Y_COP", _r)) or IsCharModel(GetPlayerPed(), GetHashKey("M_Y_COP_TRAFFIC", _r)) or IsCharModel(GetPlayerPed(), GetHashKey("M_Y_STROOPER", _r)) or IsCharModel(GetPlayerPed(), GetHashKey("M_M_FBI", _r)) or IsCharModel(GetPlayerPed(), GetHashKey("M_M_FATCOP_01", _r))) then
  69. local callerBlip = AddBlipForChar(caller, _i)
  70. ChangeBlipSprite(callerBlip, 3)
  71. ChangeBlipColour(callerBlip, 1)
  72. SetRoute(callerBlip, true)
  73. EnableGpsInVehicle(GetCarCharIsUsing(GetPlayerPed(), _i), true)
  74. ShowText("~r~911 call in progress!", 7000)
  75. end
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement