• 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!

RevScripts Online command/status (An more reliable counter)

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,084
Solutions
15
Reaction score
379
Location
Sweden
YouTube
Joriku
Hi,
sadly I think this might be out of my reach for the moment being. So i'd like to request it for more usage then just me.

I just read the thread about OTServlist.org and agree with the MC's being a problem etc.

So my request will be about:
- An updated !online + website counter. (MyAcc, Gesior, Znote) - Website counter might already be reliable enough.

But when it comes to the online command, it shows any player that's online.
Would it be easy to create a fix for it to check if a player is X-logged/standing AFK for more then X amount of minutes? (Check for Config.lua afk-kick timer)

I know this might be "unnecessary" for some people, but for me. I like legit game-style and not cheating my way up on the list by gaining afk players. I feel like it needs to be more awesome people that loves legit playstyle and don't need the extra player counter themselves to gain more cash.

If there's not, I'll give up on humanity. Too much to handle you know..

I am using the original script which is found in any engine above TFS 1.2(REV):
Lua:
local maxPlayersPerMessage = 10
local playersOnline = TalkAction("!online")

function playersOnline.onSay(player, words, param)    
    local hasAccess = player:getGroup():getAccess()
    local players = Game.getPlayers()
    local onlineList = {}

    for _, targetPlayer in ipairs(players) do
        if hasAccess or not targetPlayer:isInGhostMode() then
            table.insert(onlineList, ("%s [%d]"):format(targetPlayer:getName(), targetPlayer:getLevel()))
        end
    end

    local playersOnlineList = #onlineList
    player:sendTextMessage(MESSAGE_ATTENTION, ("%d players online!"):format(playersOnlineList))

    for i = 1, playersOnlineList, maxPlayersPerMessage do
        local j = math.min(i + maxPlayersPerMessage - 1, playersOnlineList)
        local msg = table.concat(onlineList, ", ", i, j) .. "."
        player:sendTextMessage(MESSAGE_ATTENTION, msg)
    end
    return false
end

playersOnline:register()
 
Hi,
sadly I think this might be out of my reach for the moment being. So i'd like to request it for more usage then just me.

I just read the thread about OTServlist.org and agree with the MC's being a problem etc.

So my request will be about:
- An updated !online + website counter. (MyAcc, Gesior, Znote) - Website counter might already be reliable enough.

But when it comes to the online command, it shows any player that's online.
Would it be easy to create a fix for it to check if a player is X-logged/standing AFK for more then X amount of minutes? (Check for Config.lua afk-kick timer)

I know this might be "unnecessary" for some people, but for me. I like legit game-style and not cheating my way up on the list by gaining afk players. I feel like it needs to be more awesome people that loves legit playstyle and don't need the extra player counter themselves to gain more cash.

If there's not, I'll give up on humanity. Too much to handle you know..

I am using the original script which is found in any engine above TFS 1.2(REV):
Lua:
local maxPlayersPerMessage = 10
local playersOnline = TalkAction("!online")

function playersOnline.onSay(player, words, param)   
    local hasAccess = player:getGroup():getAccess()
    local players = Game.getPlayers()
    local onlineList = {}

    for _, targetPlayer in ipairs(players) do
        if hasAccess or not targetPlayer:isInGhostMode() then
            table.insert(onlineList, ("%s [%d]"):format(targetPlayer:getName(), targetPlayer:getLevel()))
        end
    end

    local playersOnlineList = #onlineList
    player:sendTextMessage(MESSAGE_ATTENTION, ("%d players online!"):format(playersOnlineList))

    for i = 1, playersOnlineList, maxPlayersPerMessage do
        local j = math.min(i + maxPlayersPerMessage - 1, playersOnlineList)
        local msg = table.concat(onlineList, ", ", i, j) .. "."
        player:sendTextMessage(MESSAGE_ATTENTION, msg)
    end
    return false
end

playersOnline:register()
In this script, I check if the player is x-logged.
Don't have time to run through the script and help you, but it should provide you with what you need to do it on your own.

I believe I used the getIp() function to check.

 
Back
Top