Postado Agosto 13, 2018 6 anos TFS 0.4 / TIBIA 8.6 Boa tarde galera do TK. Gostaria de saber se tem como o comando !online só mostrar a quantidade de players ONLINE, pois NÃO QUERO QUE MOSTRE OS NOMES DOS JOGADORES ONLINE!!! local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local i, position = 1, 1 local added = FALSE for _, pid in ipairs(players) do if(added) then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. ", " end end if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]" i = i + 1 added = TRUE else added = FALSE end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return TRUE end
Postado Agosto 13, 2018 6 anos @baiakuda function onSay(cid, words, param, channel) local tmp = getWorldUpTime() local hours = math.ceil(tmp / 3600) - 1 local minutes = math.ceil((tmp - (3600 * hours)) / 60) if(minutes == 60) then minutes = 0 hours = hours + 1 end local showGamemasters,on,count = false,getPlayersOnline(),0 for _, cid in pairs(on) do if getPlayerAccess(cid) < 4 then count = count + 1 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Modo: PVP] - [UpTime: " .. hours .. " hours and " .. minutes .. " minutes.] - [Players Online: " .. (showGamemasters == true and #on or count) .. "]) return TRUE end
Postado Agosto 13, 2018 6 anos Autor @Dragon Ball Hiper [16:0:07.752] [Error - LuaInterface::loadFile] data/talkactions/scripts/online.lua:22: unfinished string near '"])' [16:0:07.754] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/online.lua) [16:0:07.770] data/talkactions/scripts/online.lua:22: unfinished string near '"])'
Postado Agosto 13, 2018 6 anos Solução @baiakuda function onSay(cid, words, param, channel) local tmp = getWorldUpTime() local hours = math.ceil(tmp / 3600) - 1 local minutes = math.ceil((tmp - (3600 * hours)) / 60) if(minutes == 60) then minutes = 0 hours = hours + 1 end local showGamemasters,on,count = false,getPlayersOnline(),0 for _, cid in pairs(on) do if getPlayerAccess(cid) < 4 then count = count + 1 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Modo: PVP] - [UpTime: " .. hours .. " hours and " .. minutes .. " minutes.] - [Players Online: " .. (showGamemasters == true and #on or count) .. "]") return TRUE end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.