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

+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)