Onaylı Üye
Lua:
function dump(o)
if type(o) == 'table' then
local s = ''
for k,v in pairs(o) do
s = s..dump(v)..'\n'
end
return s
else
return tostring(o)
end
end
menu.add_feature("Dump Lobby IPs", "action", 0, function()
if not network.is_session_started() then
menu.notify("Please join an online session!")
return
end
local namesips = {}
for i=0,31 do
if player.is_player_valid(i) and i ~= player.player_id() then
pIp = player.get_player_ip(i)
pIp = string.format("%i.%i.%i.%i", pIp >> 24 & 255, pIp >> 16 & 255, pIp >> 8 & 255, pIp & 255)
namesips[#namesips+1] = player.get_player_name(i)..":"..pIp
end
end
menu.notify"Dumped IPs to clipboard"
utils.to_clipboard(dump(namesips))
end)