From 59f70623df96c2ea4f49117db20adeab116f4f74 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Tue, 20 Sep 2022 22:00:13 +0200 Subject: [PATCH] Delete ND_Doorlocks directory --- ND_Doorlocks/config.lua | 38 ------------- ND_Doorlocks/fxmanifest.lua | 17 ------ ND_Doorlocks/source/client.lua | 100 --------------------------------- ND_Doorlocks/source/server.lua | 16 ------ 4 files changed, 171 deletions(-) delete mode 100644 ND_Doorlocks/config.lua delete mode 100644 ND_Doorlocks/fxmanifest.lua delete mode 100644 ND_Doorlocks/source/client.lua delete mode 100644 ND_Doorlocks/source/server.lua diff --git a/ND_Doorlocks/config.lua b/ND_Doorlocks/config.lua deleted file mode 100644 index e1897ba..0000000 --- a/ND_Doorlocks/config.lua +++ /dev/null @@ -1,38 +0,0 @@ --- For support join my discord: https://discord.gg/Z9Mxu72zZ6 - -doorList = { - -- Sandy Shores Sheriff office front door. - { - textCoords = vector3(1855.1896, 3683.4507, 34.2675), - authorizedJobs = {"BCSO", "LSPD", "BCSO"}, - locked = true, - accessDistance = 1.5, - doors = { - {hash = -1765048490, coords = vector3(1855.4108, 3683.3062, 34.2675), heading = 29.9} - } - }, - - -- Paleto bay Sheriff office office front doors. - { - textCoords = vector3(-443.6129, 6016.0483, 31.7164), - authorizedJobs = {"BCSO", "LSPD", "BCSO"}, - locked = true, - accessDistance = 1.5, - doors = { - {hash = -1501157055, coords = vector3(-443.1538, 6015.5649, 31.7164), heading = 315.0}, - {hash = -1501157055, coords = vector3(-444.1442, 6016.6621, 31.7164), heading = 135.0} - } - }, - - -- Mission Row Police Station front doors. - { - textCoords = vector3(434.7345, -981.9468, 30.7102), - authorizedJobs = {"BCSO", "LSPD", "BCSO"}, - locked = true, - accessDistance = 1.5, - doors = { - {hash = -1215222675, coords = vector3(434.8228, -981.1198, 30.6896), heading = 268.0}, - {hash = 320433149, coords = vector3(434.8228, -982.7103, 30.6896), heading = 272.0} - } - }, -} \ No newline at end of file diff --git a/ND_Doorlocks/fxmanifest.lua b/ND_Doorlocks/fxmanifest.lua deleted file mode 100644 index 82c57fb..0000000 --- a/ND_Doorlocks/fxmanifest.lua +++ /dev/null @@ -1,17 +0,0 @@ --- For support join my discord: https://discord.gg/Z9Mxu72zZ6 - -author "Andyyy#7666, N1K0#0001" -description "ND Framework Doorlocks for buildings" -version "2.1.0" - -fx_version "cerulean" -game "gta5" -lua54 "yes" - -client_scripts { - "config.lua", - "source/client.lua" -} -server_script "source/server.lua" - -dependency "ND_Core" \ No newline at end of file diff --git a/ND_Doorlocks/source/client.lua b/ND_Doorlocks/source/client.lua deleted file mode 100644 index 048871d..0000000 --- a/ND_Doorlocks/source/client.lua +++ /dev/null @@ -1,100 +0,0 @@ --- For support join my discord: https://discord.gg/Z9Mxu72zZ6 - -NDCore = exports["ND_Core"]:GetCoreObject() -local job = nil -local hasAccess = false - -function drawText3D(coords, text) - local onScreen, _x, _y = World3dToScreen2d(coords.x, coords.y, coords.z + 0.5) - local pX, pY, pZ = table.unpack(GetGameplayCamCoords()) - SetTextScale(0.4, 0.4) - SetTextFont(4) - SetTextProportional(1) - SetTextEntry("STRING") - SetTextCentre(true) - SetTextColour(255, 255, 255, 255) - SetTextOutline() - AddTextComponentString(text) - DrawText(_x, _y) -end - -function getDoorText(locked) - if locked then - if hasAccess then - return "Locked [E]" - else - return "Locked" - end - end - if hasAccess then - return "Unlocked [E]" - else - return "" - end -end - -function isAuthorized(door) - for _, authorizedJob in pairs(door.authorizedJobs) do - if job == authorizedJob then - return true - end - end - return false -end - -RegisterNetEvent("ND:setCharacter", function(character) - job = character.job -end) - -AddEventHandler("playerSpawned", function() - TriggerServerEvent("ND_Doorlocks:getDoors") -end) - -Citizen.CreateThread(function() - while true do - pedCoords = GetEntityCoords(PlayerPedId()) - Citizen.Wait(1000) - end -end) - -Citizen.CreateThread(function() - while true do - for doorID, door in pairs(doorList) do - if #(pedCoords - door.textCoords) < door.accessDistance then - hasAccess = isAuthorized(door) - drawText3D(door.textCoords, getDoorText(door.locked)) - for _, doors in pairs(door.doors) do - local entity = GetClosestObjectOfType(doors.coords.x, doors.coords.y, doors.coords.z, 1.0, doors.hash, false, false, false) - FreezeEntityPosition(entity, door.locked) - end - end - if IsControlJustPressed(0, 51) then - if hasAccess then - door.locked = not door.locked - TriggerServerEvent("ND_Doorlocks:syncDoor", doorID, door.locked) - end - end - end - Citizen.Wait(0) - end -end) - -RegisterNetEvent("ND_Doorlocks:syncDoor", function(doorID, state) - doorList[doorID].locked = state - for _, doors in pairs(doorList[doorID].doors) do - local entity = GetClosestObjectOfType(doors.coords.x, doors.coords.y, doors.coords.z, 1.0, doors.hash, false, false, false) - SetEntityHeading(entity, doors.heading) - FreezeEntityPosition(entity, state) - end -end) - -RegisterNetEvent("ND_Doorlocks:returnDoors", function(updatedDoors) - for doorID, state in pairs(updatedDoors) do - doorList[doorID].locked = state - for _, doors in pairs(doorList[doorID].doors) do - local entity = GetClosestObjectOfType(doors.coords.x, doors.coords.y, doors.coords.z, 1.0, doors.hash, false, false, false) - SetEntityHeading(entity, doors.heading) - FreezeEntityPosition(entity, state) - end - end -end) \ No newline at end of file diff --git a/ND_Doorlocks/source/server.lua b/ND_Doorlocks/source/server.lua deleted file mode 100644 index a11c83c..0000000 --- a/ND_Doorlocks/source/server.lua +++ /dev/null @@ -1,16 +0,0 @@ --- For support join my discord: https://discord.gg/Z9Mxu72zZ6 - -NDCore = exports["ND_Core"]:GetCoreObject() -NDCore.Functions.VersionChecker("ND_Doorlocks", GetCurrentResourceName(), "https://github.com/Andyyy7666/ND_Framework", "https://raw.githubusercontent.com/Andyyy7666/ND_Framework/main/ND_Doorlocks/fxmanifest.lua") - -local updatedDoors = {} - -RegisterNetEvent("ND_Doorlocks:syncDoor", function(doorID, state) - updatedDoors[doorID] = state - TriggerClientEvent("ND_Doorlocks:syncDoor", -1, doorID, state) -end) - -RegisterNetEvent("ND_Doorlocks:getDoors", function() - local player = source - TriggerClientEvent("ND_Doorlocks:returnDoors", player, updatedDoors) -end) \ No newline at end of file