Advertisement
rcs2112

Untitled

Dec 10th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Citizen.CreateThread(function()
  2. while true do
  3. Citizen.Wait(1)
  4.  
  5. local coords, currentZone = GetEntityCoords(PlayerPedId()), nil
  6.  
  7. for i=1, #Config.Zones, 1 do
  8. if GetDistanceBetweenCoords(coords, Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z, true) < (Config.ZoneSize.x / 2) then
  9. isInJoblistingMarker = true
  10. ESX.ShowHelpNotification(_U('access_job_center'))
  11. end
  12. end
  13.  
  14. if isInJoblistingMarker and not hasAlreadyEnteredMarker then
  15. hasAlreadyEnteredMarker = true
  16. end
  17.  
  18. if not isInJoblistingMarker and hasAlreadyEnteredMarker then
  19. hasAlreadyEnteredMarker = false
  20. TriggerEvent('esx_joblisting:hasExitedMarker')
  21. end
  22. end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement