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



Committed as rev 1220.

but i have another problem. with the OnPlayerPlacingBlock Hook the BlockType gives a random number but not the block the player placed. for example i placed some sand blocks(12) and the server responded with 9, 16 and 4. it seems it changes when the place of the hitbox changes.