Housing
function Property:PlayerEnter(src)
local _src = tostring(src)
local isMlo = self.propertyData.shell == 'mlo'
local isIpl = self.propertyData.apartment and Config.Apartments[self.propertyData.apartment].interior
self.playersInside[_src] = true
if not isMlo then
-- HERE WE TRIGGER THE WEATHER EVENT:
-- Player weather will be frozen untill we sync it again
TriggerClientEvent('av_weather:freeze', src, true, 23, 0, 'CLEAR')
-- TriggerClientEvent('qb-weathersync:client:DisableSync', src)
end
TriggerClientEvent('ps-housing:client:enterProperty', src, self.property_id, isMlo, self.propertyData)
if next(self.playersDoorbell) then
TriggerClientEvent("ps-housing:client:updateDoorbellPool", src, self.property_id, self.playersDoorbell)
if self.playersDoorbell[_src] then
self.playersDoorbell[_src] = nil
end
end
local citizenid = GetCitizenid(src)
if self:CheckForAccess(citizenid) then
local Player = QBCore.Functions.GetPlayer(src)
local insideMeta = Player.PlayerData.metadata["inside"]
insideMeta.property_id = self.property_id
Player.Functions.SetMetaData("inside", insideMeta)
end
if not isMlo or isIpl then
local bucket = tonumber(self.property_id) -- because the property_id is a string
QBCore.Functions.SetPlayerBucket(src, bucket)
end
endLast updated