experimental housing module - wip

This commit is contained in:
MrNewb committed 2025-04-15 07:06:57 -04:00
1 parent 01f7b385c1
commit 329d3328d8
14 files changed
+86

No files matched your search

+2
View File
@@ -28,6 +28,7 @@ server_scripts {
'modules/clothing/**/server.lua',
'modules/shops/**/server.lua',
'modules/notify/**/server.lua',
'modules/housing/**/server.lua',
'init.lua',
}
@@ -50,6 +51,7 @@ client_scripts {
'modules/notify/**/client.lua',
'modules/dialogue/**/client/*.lua',
'modules/shops/**/client.lua',
'modules/housing/**/client.lua',
'modules/accessibility/client.lua',
'init.lua',
}
+1
View File
@@ -53,6 +53,7 @@ Bridge.RegisterModule("Doorlock", Doorlock)
Bridge.RegisterModule("Phone", Phone)
Bridge.RegisterModule("Dispatch", Dispatch)
Bridge.RegisterModule("Shops", Shops)
Bridge.RegisterModule("Housing", Housing)
--lib
Bridge.RegisterModule("Tables", cLib.Tables)
+1
View File
@@ -0,0 +1 @@
Housing = Housing or {}
+12
View File
@@ -0,0 +1,12 @@
Housing = Housing or {}
---This is an internal event, listen for 'community_bridge:Client:OnPlayerInside' instead.
---This event is triggered when a player enters or leaves a property.
---@param src number
---@param insideId string
RegisterNetEvent('community_bridge:Server:_OnPlayerInside', function(src, insideId)
local currentBucket = GetPlayerRoutingBucket(src)
local playerEntity = GetPlayerPed(src)
local playerCoords = GetEntityCoords(playerEntity)
TriggerEvent('community_bridge:Client:OnPlayerInside', src, insideId, currentBucket, playerCoords)
end)
+11
View File
@@ -0,0 +1,11 @@
if GetResourceState('bcs-housing') ~= 'started' then return end
Housing = Housing or {}
RegisterNetEvent('Housing:client:EnterHome', function(insideId)
TriggerServerEvent('community_bridge:Server:_OnPlayerInside', insideId)
end)
RegisterNetEvent("Housing:client:DeleteFurnitures", function()
TriggerServerEvent('community_bridge:Server:_OnPlayerInside', false)
end)
+3
View File
@@ -0,0 +1,3 @@
if GetResourceState('bcs-housing') ~= 'started' then return end
Housing = Housing or {}
+3
View File
@@ -0,0 +1,3 @@
if GetResourceState('esx_property') ~= 'started' then return end
Housing = Housing or {}
+13
View File
@@ -0,0 +1,13 @@
if GetResourceState('esx_property') ~= 'started' then return end
Housing = Housing or {}
RegisterNetEvent('esx_property:enter', function(insideId)
local src = source
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)
RegisterNetEvent('esx_property:leave', function(insideId)
local src = source
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)
+3
View File
@@ -0,0 +1,3 @@
if GetResourceState('ps-housing') ~= 'started' then return end
Housing = Housing or {}
+13
View File
@@ -0,0 +1,13 @@
if GetResourceState('ps-housing') ~= 'started' then return end
Housing = Housing or {}
RegisterNetEvent('ps-housing:server:enterProperty', function(insideId)
local src = source
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)
RegisterNetEvent('ps-housing:server:leaveProperty', function(insideId)
local src = source
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)
@@ -0,0 +1,3 @@
if GetResourceState('qb-appartments') ~= 'started' then return end
Housing = Housing or {}
@@ -0,0 +1,9 @@
if GetResourceState('qb-appartments') ~= 'started' then return end
Housing = Housing or {}
RegisterNetEvent('qb-apartments:server:SetInsideMeta', function(house, insideId, bool, isVisiting)
local src = source
insideId = bool and house .. '-' .. insideId or nil
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)
+3
View File
@@ -0,0 +1,3 @@
if GetResourceState('qb-houses') ~= 'started' then return end
Housing = Housing or {}
+9
View File
@@ -0,0 +1,9 @@
if GetResourceState('qb-houses') ~= 'started' then return end
Housing = Housing or {}
RegisterNetEvent('qb-houses:server:SetInsideMeta', function(insideId, bool)
local src = source
insideId = bool and insideId or nil
TriggerEvent('community_bridge:Server:_OnPlayerInside', src, insideId)
end)