mccheck.lua

main 37 lines · 951 bytes Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onSay(player, words, param)
2 if player:getGroup():getId() < 3 then
3 return false
4 end
5
6 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Multiclient Check List:")
7
8 local ipList = {}
9 local players = Game.getPlayers()
10 for i = 1, #players do
11 local tmpPlayer = players[i]
12 local ip = tmpPlayer:getIp()
13 if ip ~= 0 then
14 local list = ipList[ip]
15 if not list then
16 ipList[ip] = {}
17 list = ipList[ip]
18 end
19 list[#list + 1] = tmpPlayer
20 end
21 end
22
23 for ip, list in pairs(ipList) do
24 local listLength = #list
25 if listLength > 1 then
26 local tmpPlayer = list[1]
27 local message = ("%s: %s [%d]"):format(Game.convertIpToString(ip), tmpPlayer:getName(), tmpPlayer:getLevel())
28 for i = 2, listLength do
29 tmpPlayer = list[i]
30 message = ("%s, %s [%d]"):format(message, tmpPlayer:getName(), tmpPlayer:getLevel())
31 end
32 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message .. ".")
33 end
34 end
35 return false
36end
37
Top