GetPlayers added

while theres a native to do this, the purpose of this is using the framework methods, this will only return logged in players ie wont include people who are in multichar and still not logged in
This commit is contained in:
MrNewb committed 2025-04-14 01:16:06 -04:00
1 parent 663e3bc9c1
commit 870f440a1b
3 files changed
+33

No files matched your search

+11
View File
@@ -35,6 +35,17 @@ Framework.GetPlayerName = function(src)
return xPlayer.variables.firstName, xPlayer.variables.lastName
end
---This will return a table of all logged in players
---@return table
Framework.GetPlayers = function()
local players = ESX.GetExtendedPlayers()
local playerList = {}
for _, xPlayer in pairs(players) do
table.insert(playerList, xPlayer.source)
end
return playerList
end
-- Framework.GetItem(src, item, metadata)
-- Returns a table of items matching the specified name and if passed metadata from the player's inventory.
-- returns {name = v.name, count = v.amount, metadata = v.info, slot = v.slot}