opti: pairs(player.GetAll()) -> ipairs(player.GetAll())

This commit is contained in:
Linventif 2024-07-09 09:07:59 +00:00
parent 9324d7c293
commit 4dc2a46dc3
4 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ local conFuncs = {
["get-server-id"] = function() print(gmInte.config.id || "none") end,
["screenshot"] = function(args)
if !args[2] then return gmInte.log("No SteamID64 provided") end
for _, ply in pairs(player.GetAll()) do
for _, ply in ipairs(player.GetAll()) do
if ply:SteamID64() == args[2] then return gmInte.takeScreenshot(ply) end
end
end,

View File

@ -90,7 +90,7 @@ end
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply) gmInte.playerReady(ply) end)
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", function()
for ply, ply in pairs(player.GetAll()) do
for ply, ply in ipairs(player.GetAll()) do
gmInte.playerDisconnected(ply)
end
end)

View File

@ -14,7 +14,7 @@ function gmInte.saveSetting(setting, value)
gmInte.log("Setting Saved")
if value == "websocketFQDN" || value == "id" || value == "token" then gmInte.resetWebSocket() end
// send to all players the new public config
for _, ply in pairs(player.GetAll()) do
for _, ply in ipairs(player.GetAll()) do
if ply:IsValid() && ply:IsPlayer(ply) then
gmInte.log("Sending new Public Config to " .. ply:Nick(), true)
gmInte.publicGetConfig(ply)

View File

@ -19,7 +19,7 @@ end
function gmInte.getPlayersFormat()
local players = {}
for k, v in pairs(player.GetAll()) do
for k, v in ipairs(player.GetAll()) do
table.insert(players, gmInte.getPlayerFormat(v))
end
return players