02-19-2013, 10:58 PM
got a fix for the /players command in console. it was actualy pretty simple. this is the function:
function HandleConsolePlayers(Split) local PlayersInWorlds = {}; -- "WorldName" => [players array] local AddToTable = function(Player) local WorldName = Player:GetWorld():GetName(); if (PlayersInWorlds[WorldName] == nil) then PlayersInWorlds[WorldName] = {}; end table.insert(PlayersInWorlds[WorldName], Player:GetName() .. " " .. Player:GetIP()); end cRoot:Get():ForEachPlayer(AddToTable); for WorldName, Players in pairs(PlayersInWorlds) do LOG("World " .. WorldName .. ":"); for i, PlayerName in ipairs(Players) do LOG(" " .. PlayerName); end end return true; end