• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[0.3.6] 8.60 Staff /mc command to now show staff characters

Samaster

Raptorserver.ddns.net
Joined
Jun 9, 2013
Messages
291
Reaction score
23
Location
UK
Hi OTLand, my request is pretty much the title.. I need a /mc command to not show up staff characters if possible?

Thanks
 
Untested.
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)
                   if(_ip == 0) then
                       _ip = nil
                   end
               end
           else
               _ip = doConvertIpToInteger(revertIp)
           end
       end
   end

   local list, ips, players = {}, {}, getPlayersOnline()
   for i, pid in ipairs(players) do
       local ip = getPlayerIp(pid)
       if(ip ~= 0) then
           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
           if getPlayerAccess(pid) < 3 then
               table.insert(ips, ip)
           end
       end
   end

   local total = table.maxn(list)
   if(total > 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
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Total: " .. total .. " clients with more than one connection.")
   else
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently there aren't any players with same IP address(es).")
   end

   return true
end
 
Untested.
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)
                   if(_ip == 0) then
                       _ip = nil
                   end
               end
           else
               _ip = doConvertIpToInteger(revertIp)
           end
       end
   end

   local list, ips, players = {}, {}, getPlayersOnline()
   for i, pid in ipairs(players) do
       local ip = getPlayerIp(pid)
       if(ip ~= 0) then
           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
           if getPlayerAccess(pid) < 3 then
               table.insert(ips, ip)
           end
       end
   end

   local total = table.maxn(list)
   if(total > 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
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Total: " .. total .. " clients with more than one connection.")
   else
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently there aren't any players with same IP address(es).")
   end

   return true
end

I have tested this on my test server and it just seems it ignores the first character logged in. I had 2 characters logged in (1 being god and other being a player) and it worked, but then I checked with 3 players (1 god and 2 players) and it seemed to have just ignored the first character logged in (which was a normal player) so my god characters appeared in the mc list
 
I have tested this on my test server and it just seems it ignores the first character logged in. I had 2 characters logged in (1 being god and other being a player) and it worked, but then I checked with 3 players (1 god and 2 players) and it seemed to have just ignored the first character logged in (which was a normal player) so my god characters appeared in the mc list
Can you post your current working script?
All I added was..
Code:
if getPlayerAccess(pid) < 3 then
    table.insert(ips, ip)
end
 
Can you post your current working script?
All I added was..
Code:
if getPlayerAccess(pid) < 3 then
    table.insert(ips, ip)
end

This is my original code for MC check

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
 
Back
Top