Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if distance < maxDistance then
- sleepThread = 5
- if doorsChanging[i] == nil then
- doorsChanging[i] = false
- end
- local displayText
- if not doorsChanging[i] then
- displayText = "Odemčeno"
- if doorID.locked then
- displayText = "Zamčeno"
- end
- else
- displayText = "Zamykám"
- if doorID.locked then
- displayText = "Odemykám"
- end
- end
- if doorID.isAuthorized and not doorsChanging[i] and doorID.houseId == nil then
- displayText = "[E] " .. displayText
- end
- DrawText3D(doorID.text.x, doorID.text.y, doorID.text.z, displayText)
- if (doorID.isAuthorized or (forcingIn == true and doorID.locked)) and not doorsChanging[i] and (IsControlJustReleased(0, 38) or (forcingIn == true and doorID.locked)) then
- local continue = true
- if doorID.houseId ~= nil and not forcingIn then
- continue = exports.household:hasHousePermissions(doorID.houseId, "lock")
- end
- if continue then
- doorsChanging[i] = true
- Citizen.CreateThread(
- function()
- if not IsPedInAnyVehicle(PlayerPedId()) then
- if forcingIn then
- exports.dpemotes:EmotePlayByName("mechanic4")
- else
- while (not HasAnimDictLoaded("anim@heists@keycard@")) do
- RequestAnimDict("anim@heists@keycard@")
- Citizen.Wait(5)
- end
- TaskPlayAnim(GetPlayerPed(-1), "anim@heists@keycard@", "exit", 8.0, 1.0, -1, 49, 0, 0, 0, 0)
- end
- else
- if forcingIn then
- doorsChanging[i] = false
- end
- end
- forcingIn = false
- if doorsChanging[i] then
- Citizen.Wait(850)
- ClearPedTasks(PlayerPedId())
- exports.dpemotes:EmoteCancel()
- doorID.locked = not doorID.locked
- TriggerServerEvent("doorlock:updateState", i, doorID.locked)
- doorsChanging[i] = false
- applyDoorState(i)
- end
- end
- )
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement