mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
opti: pairs(player.GetAll()) -> ipairs(player.GetAll())
This commit is contained in:
parent
9324d7c293
commit
4dc2a46dc3
|
@ -6,7 +6,7 @@ local conFuncs = {
|
||||||
["get-server-id"] = function() print(gmInte.config.id || "none") end,
|
["get-server-id"] = function() print(gmInte.config.id || "none") end,
|
||||||
["screenshot"] = function(args)
|
["screenshot"] = function(args)
|
||||||
if !args[2] then return gmInte.log("No SteamID64 provided") end
|
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
|
if ply:SteamID64() == args[2] then return gmInte.takeScreenshot(ply) end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -90,7 +90,7 @@ end
|
||||||
|
|
||||||
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply) gmInte.playerReady(ply) end)
|
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply) gmInte.playerReady(ply) end)
|
||||||
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", function()
|
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)
|
gmInte.playerDisconnected(ply)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -14,7 +14,7 @@ function gmInte.saveSetting(setting, value)
|
||||||
gmInte.log("Setting Saved")
|
gmInte.log("Setting Saved")
|
||||||
if value == "websocketFQDN" || value == "id" || value == "token" then gmInte.resetWebSocket() end
|
if value == "websocketFQDN" || value == "id" || value == "token" then gmInte.resetWebSocket() end
|
||||||
// send to all players the new public config
|
// 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
|
if ply:IsValid() && ply:IsPlayer(ply) then
|
||||||
gmInte.log("Sending new Public Config to " .. ply:Nick(), true)
|
gmInte.log("Sending new Public Config to " .. ply:Nick(), true)
|
||||||
gmInte.publicGetConfig(ply)
|
gmInte.publicGetConfig(ply)
|
||||||
|
|
|
@ -19,7 +19,7 @@ end
|
||||||
|
|
||||||
function gmInte.getPlayersFormat()
|
function gmInte.getPlayersFormat()
|
||||||
local players = {}
|
local players = {}
|
||||||
for k, v in pairs(player.GetAll()) do
|
for k, v in ipairs(player.GetAll()) do
|
||||||
table.insert(players, gmInte.getPlayerFormat(v))
|
table.insert(players, gmInte.getPlayerFormat(v))
|
||||||
end
|
end
|
||||||
return players
|
return players
|
||||||
|
|
Loading…
Reference in New Issue
Block a user