Shadowman321
Member
- Joined
- Mar 27, 2010
- Messages
- 205
- Reaction score
- 22
Can anyone upgrade my /mc command?
Now it shows sth like this:
And I want to sort it and show count of ips... Something like:
I'm using default /mc script:
Ahh. For sure. I'm using TFS 0.4 r3884.
Or if it is too much job to do, just sort list by ips so it get easier to count. It would be great too.
Now it shows sth like this:
It's hard to know how many real players is there. How many characters specific ip has. And how many multipled characters there is.00:01 Currently online players with same IP address(es):
00:01 Char (213.238.78.82)
00:01 Char Iii (113.1111.22.6)
00:01 Char Ii (213.238.78.82)
00:01 Char Xx(213.238.78.82)
00:01 Char Zz (113.1111.22.6)
And I want to sort it and show count of ips... Something like:
00:01 Total players on mc = 5, multi players = 3, unique ips = 2.
00:01 There is 251 players online. 3 of them are multipled. You have 248 real players online now.
00:01 IP 213.238.78.82 (3 players):
00:01 Char, Char Ii, Char Xx
00:01 IP 113.1111.22.6 (2 players):
00:01 Char Iii, Char Zz
I'm using default /mc script:
Code:
function onSay(cid, words, param, channel)
local _ip = nil
if(param ~= '') then
_ip = tonumber(param)
if(not _ip or _ip == 0) then
local revertIp = doRevertIp(param)
if(not revertIp) then
local tid = getPlayerByNameWildcard(param)
if(not tid) then
_ip = nil
else
_ip = getPlayerIp(tid)
end
else
_ip = doConvertIpToInteger(revertIp)
end
end
end
local list, ips = {}, {}
local players = getPlayersOnline()
for i, pid in ipairs(players) do
local ip = getPlayerIp(pid)
local tmp = table.find(ips, ip)
if(tmp ~= nil and (not _ip or _ip == ip)) then
if(table.countElements(list, ip) == 0) then
list[players[tmp]] = ip
end
list[pid] = ip
end
table.insert(ips, ip)
end
if(table.maxn(list) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently online players with same IP address(es):")
for pid, ip in pairs(list) do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " (" .. doConvertIntegerToIp(ip) .. ")")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently there aren't any players with same IP address(es).")
end
return true
end
Ahh. For sure. I'm using TFS 0.4 r3884.
Or if it is too much job to do, just sort list by ips so it get easier to count. It would be great too.
Last edited: