The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Panic Button
By Guest on 1st December 2018 02:10:42 PM | Syntax: LUA | Views: 20



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. ESX                           = nil
  2. local PlayerData              = {}
  3. Citizen.CreateThread(function()
  4.  
  5.         while ESX == nil do
  6.                 TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  7.                 Citizen.Wait(0)
  8.         end
  9.  
  10. end)
  11.  
  12. RegisterNetEvent('esx:playerLoaded')
  13. AddEventHandler('esx:playerLoaded', function(xPlayer)
  14.   PlayerData = xPlayer
  15. end)
  16.  
  17. RegisterNetEvent('esx:setJob')
  18. AddEventHandler('esx:setJob', function(job)
  19.   PlayerData.job = job
  20. end)
  21.  
  22. Citizen.CreateThread(function()
  23.     while true do
  24.         Citizen.Wait(0)
  25.         if IsControlJustReleased(0, 57) and GetLastInputMethod( 0 ) and PlayerData.job ~= nil and PlayerData.job.name == 'police' then -- Set to the "F10" Key
  26.             local ped = PlayerPedId()
  27.             local x,y,z = table.unpack(GetEntityCoords(ped, false))
  28.             local streetName, crossing = GetStreetNameAtCoord(x, y, z)
  29.             streetName = GetStreetNameFromHashKey(streetName)
  30.             local message = ""
  31.             if crossing ~= nil then
  32.                 crossing = GetStreetNameFromHashKey(crossing)
  33.                 message = "^4" .. GetPlayerName(PlayerId()) .. "^1 has called a 10-13 near ^3" .. streetName .. " ^1and ^3" .. crossing .. " ^1all units break and roll code 3."
  34.             else
  35.                 message = "^4" .. GetPlayerName(PlayerId()) .. "^1 has called a 10-13 near ^3" .. streetName .. " ^1all units break and roll code 3."
  36.             end
  37.             TriggerServerEvent('sendChatMessage', message)
  38.         end
  39.     end
  40. end)



  • Recent Pastes
Want an Image ad here for ONLY $10.00 US a month? Contact Us!
Want an Image ad here for ONLY $10.00 US a month? Contact Us!