mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
Full Distribution
This commit is contained in:
40
data/talkactions/scripts/mccheck.lua
Normal file
40
data/talkactions/scripts/mccheck.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
function onSay(player, words, param)
|
||||
if not player:getGroup():getAccess() then
|
||||
return true
|
||||
end
|
||||
|
||||
if player:getAccountType() < ACCOUNT_TYPE_GOD then
|
||||
return false
|
||||
end
|
||||
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Multiclient Check List:")
|
||||
|
||||
local ipList = {}
|
||||
local players = Game.getPlayers()
|
||||
for i = 1, #players do
|
||||
local tmpPlayer = players[i]
|
||||
local ip = tmpPlayer:getIp()
|
||||
if ip ~= 0 then
|
||||
local list = ipList[ip]
|
||||
if not list then
|
||||
ipList[ip] = {}
|
||||
list = ipList[ip]
|
||||
end
|
||||
list[#list + 1] = tmpPlayer
|
||||
end
|
||||
end
|
||||
|
||||
for ip, list in pairs(ipList) do
|
||||
local listLength = #list
|
||||
if listLength > 1 then
|
||||
local tmpPlayer = list[1]
|
||||
local message = ("%s: %s [%d]"):format(Game.convertIpToString(ip), tmpPlayer:getName(), tmpPlayer:getLevel())
|
||||
for i = 2, listLength do
|
||||
tmpPlayer = list[i]
|
||||
message = ("%s, %s [%d]"):format(message, tmpPlayer:getName(), tmpPlayer:getLevel())
|
||||
end
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message .. ".")
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
Reference in New Issue
Block a user