feat: get all players & by metadata

This commit is contained in:
Andyyy7666
2023-07-09 03:38:17 +02:00
parent abad068eb7
commit 24caa1a857

View File

@@ -4,6 +4,17 @@ function NDCore.getPlayer(src)
return ActivePlayers[src]
end
function NDCore.getPlayers(metadata, data)
if not metadata or not data then return ActivePlayers end
local players = {}
for src, info in pairs(ActivePlayers) do
if info.metadata[metadata] == data then
players[src] = info
end
end
return players
end
AddEventHandler("playerDropped", function()
local src = source
local char = ActivePlayers[src]