Postado Novembro 11, 2012 12 anos Queria um !online que só mostra-se quantos players tem online e não mostra-se os nomes e tal...
Postado Novembro 11, 2012 12 anos Como assim você fala !online e não aparece ou você fala !online e aparece exemplo 2knights e 1 paladin é assim que aparece?Explica melhor... Você quer um !online que aparece nome dos Players por exemplo: [320] Test, [210] Knight ... assim? "Embora ninguém possa voltar atrás e fazer um novo começo, qualquer um pode começar agora e fazer um novo fim"
Postado Novembro 11, 2012 12 anos 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 no servidor") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end end return TRUE end
Postado Novembro 11, 2012 12 anos Autor 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 no servidor") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end end return TRUE end Exatamente isso, funcionou direitinho, obrigado. +REP
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.