Advertisement
Trsak

Untitled

Feb 25th, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. if distance < maxDistance then
  2. sleepThread = 5
  3.  
  4. if doorsChanging[i] == nil then
  5. doorsChanging[i] = false
  6. end
  7.  
  8. local displayText
  9. if not doorsChanging[i] then
  10. displayText = "Odemčeno"
  11. if doorID.locked then
  12. displayText = "Zamčeno"
  13. end
  14. else
  15. displayText = "Zamykám"
  16. if doorID.locked then
  17. displayText = "Odemykám"
  18. end
  19. end
  20. if doorID.isAuthorized and not doorsChanging[i] and doorID.houseId == nil then
  21. displayText = "[E] " .. displayText
  22. end
  23.  
  24. DrawText3D(doorID.text.x, doorID.text.y, doorID.text.z, displayText)
  25.  
  26. if (doorID.isAuthorized or (forcingIn == true and doorID.locked)) and not doorsChanging[i] and (IsControlJustReleased(0, 38) or (forcingIn == true and doorID.locked)) then
  27. local continue = true
  28. if doorID.houseId ~= nil and not forcingIn then
  29. continue = exports.household:hasHousePermissions(doorID.houseId, "lock")
  30. end
  31.  
  32. if continue then
  33. doorsChanging[i] = true
  34. Citizen.CreateThread(
  35. function()
  36. if not IsPedInAnyVehicle(PlayerPedId()) then
  37. if forcingIn then
  38. exports.dpemotes:EmotePlayByName("mechanic4")
  39. else
  40. while (not HasAnimDictLoaded("anim@heists@keycard@")) do
  41. RequestAnimDict("anim@heists@keycard@")
  42. Citizen.Wait(5)
  43. end
  44.  
  45. TaskPlayAnim(GetPlayerPed(-1), "anim@heists@keycard@", "exit", 8.0, 1.0, -1, 49, 0, 0, 0, 0)
  46. end
  47. else
  48. if forcingIn then
  49. doorsChanging[i] = false
  50. end
  51. end
  52. forcingIn = false
  53. if doorsChanging[i] then
  54. Citizen.Wait(850)
  55. ClearPedTasks(PlayerPedId())
  56. exports.dpemotes:EmoteCancel()
  57.  
  58. doorID.locked = not doorID.locked
  59.  
  60. TriggerServerEvent("doorlock:updateState", i, doorID.locked)
  61. doorsChanging[i] = false
  62. applyDoorState(i)
  63. end
  64. end
  65. )
  66. end
  67. end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement