first commit

This commit is contained in:
Colin-Joel Scupin
2026-08-05 01:29:39 +02:00
commit 86d4bcdc37
85 changed files with 7706 additions and 0 deletions
@@ -0,0 +1,37 @@
local function buildSnapshots()
local byBucket = {}
local activePlayers = exports.devx_core:GetActivePlayers()
for source, player in pairs(activePlayers) do
source = tonumber(source)
local ped = GetPlayerPed(source)
if ped and ped > 0 and DoesEntityExist(ped) then
local coords = GetEntityCoords(ped)
local bucket = GetPlayerRoutingBucket(source)
byBucket[bucket] = byBucket[bucket] or {}
byBucket[bucket][#byBucket[bucket] + 1] = {
serverId = source,
name = player.fullName or GetPlayerName(source) or ('Spieler %s'):format(source),
x = coords.x,
y = coords.y,
z = coords.z,
heading = GetEntityHeading(ped)
}
end
end
return byBucket, activePlayers
end
CreateThread(function()
while true do
Wait(1500)
local snapshots, activePlayers = buildSnapshots()
for source in pairs(activePlayers) do
source = tonumber(source)
local bucket = GetPlayerRoutingBucket(source)
TriggerClientEvent('devx_players:client:sync', source, snapshots[bucket] or {})
end
end
end)