Postado Julho 13, 2014 10 anos olá bem o que eu gostaria é de mudar o script talkactions online.lua normalmente o player quando escreve !online .... aparece ... ex: 10 player online .... nome do player [120] nome do player 2 [200] eu gostaria de alterar mostrando só a quantidade de player e uma mensagem de texto (a minha vontade) Editado Julho 16, 2014 10 anos por Malblofor (veja o histórico de edições)
Postado Julho 13, 2014 10 anos tenta isso coloca no online.lua function onSay(cid, words, param) local player = Player(cid) local hasAccess = player:getGroup():getAccess() local players = Game.getPlayers() local playerCount = Game.getPlayerCount() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.") local i = 0 local msg = "" for k, tmpPlayer in ipairs(players) do if hasAccess or not tmpPlayer:isInGhostMode() then if i > 0 then msg = msg .. ", " end msg = msg .. tmpPlayer:getName() .. i = i + 1 end if i == 10 then if k == playerCount then msg = msg .. "." else msg = msg .. "," end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) msg = "" i = 0 end end if i > 0 then msg = msg .. "." player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) end return false end
Postado Julho 13, 2014 10 anos tenta isso coloca no online.lua function onSay(cid, words, param) local player = Player(cid) local hasAccess = player:getGroup():getAccess() local players = Game.getPlayers() local playerCount = Game.getPlayerCount() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.") local i = 0 local msg = "" for k, tmpPlayer in ipairs(players) do if hasAccess or not tmpPlayer:isInGhostMode() then if i > 0 then msg = msg .. ", " end msg = msg .. tmpPlayer:getName() .. i = i + 1 end if i == 10 then if k == playerCount then msg = msg .. "." else msg = msg .. "," end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) msg = "" i = 0 end end if i > 0 then msg = msg .. "." player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) end return false end O seu não vai aparecer os leveis, ele quer que apareça o player com o level. Tente esse : function onSay(cid, words, param, channel) local strings, i, position, added, showGamemasters = {""}, 1, 1, false, getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) for _, pid in ipairs(getPlayersOnline()) 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 added = false if((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 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " 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 Editado Julho 13, 2014 10 anos por tetheuscunha (veja o histórico de edições)
Postado Julho 13, 2014 10 anos Autor não não pessoal, vocês não entenderam .... Eu não quero que apareça nenhum nome do player e level, quero só a quantidade de player online em numero .... e que eu possa escrever um texto depois disso.
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.