fix sure real estate can see nearby players

This commit is contained in:
Mycroft
2022-08-11 09:48:58 +01:00
parent 42547ec118
commit 4d98c5e399
+9 -9
View File
@@ -739,15 +739,15 @@ ESX.RegisterServerCallback('esx_property:GetNearbyPlayers', function(source, cb,
local Property = Properties[property]
local Players = {}
local xPlayer = ESX.GetPlayerFromId(source)
local NearbyPlayers = ESX.OneSync.GetPlayersInArea(vector3(Property.Entrance.x, Property.Entrance.y, Property.Entrance.z), 5.0)
Wait(100)
for k, v in pairs(NearbyPlayers) do
local xTarget = ESX.GetPlayerFromId(v.id)
---if xPlayer.identifier ~= xTarget.identifier then
Players[#Players + 1] = {name = xTarget.getName(), source = xTarget.source}
-- end
end
cb(Players)
ESX.OneSync.GetPlayersInArea(vector3(Property.Entrance.x, Property.Entrance.y, Property.Entrance.z), 5.0, function(NearbyPlayers)
for k, v in pairs(NearbyPlayers) do
local xTarget = ESX.GetPlayerFromId(v.id)
---if xPlayer.identifier ~= xTarget.identifier then
Players[#Players + 1] = {name = xTarget.getName(), source = xTarget.source}
-- end
end
cb(Players)
end)
end)
ESX.RegisterServerCallback('esx_property:GetPlayersWithKeys', function(source, cb, property)