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

!online talkactions script

Dorianek

Member
Joined
Nov 29, 2018
Messages
247
Reaction score
10
Location
Poland
how to edit the ten script so that after entering it does not display (1 online players, 2 players online) only something on the principle of a book in which they will be:



Character nickname, level, online time



my current Script

C++:
function onSay(player, words, param)
    local hasAccess = player:getGroup():getAccess()
    local players = Game.getPlayers()
    local playerCount = Game.getPlayerCount()--+69 -- spoofing

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.")
    return false
end
 
Why do you check player access? Is it only suppose to be used by GM's?

Not entirely sure if this is what you want, but good enough. Shows online time in seconds.

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return false
    end
    local players = Game.getPlayers()
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, #players .. " players online.")
    for k, v in pairs(players) do
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, k .. ". " .. v:getName() .. " " .. v:getLevel() .. " " .. os.time() - v:getLastLoginSaved())
    end
    return false
end
 
Last edited:
Back
Top