AdilsonHacker 98 Postado Janeiro 25, 2014 Share Postado Janeiro 25, 2014 Eai Galera suave ? bom vim aqui pedir a ajuda de vocês .. preciso de um script !online diferente que ele funcione normalmente só que no final apareça tipo isso . EXEMPLO / IMAGEM : Desde já , agradeço ! Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/ Compartilhar em outros sites More sharing options...
0 Wuv4 9 Postado Janeiro 25, 2014 Share Postado Janeiro 25, 2014 Substitua a talkaction online.lua por essa: local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local vocationCount = { [1] = 0, [2] = 0, [3] = 0, [4] = 0, } 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 local voc = getPlayerVocation(pid) if voc > 4 then voc = voc-4 end vocationCount[voc] = vocationCount[voc] + 1 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) .. " jogadores online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end str = str .. " \n"..vocationCount[1].." sorcerers, "..vocationCount[2].." druids, "..vocationCount[3].." paladins, "..vocationCount[4].." knights jogando agora." doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1608551 Compartilhar em outros sites More sharing options...
0 AdilsonHacker 98 Postado Janeiro 30, 2014 Autor Share Postado Janeiro 30, 2014 Mano primeiramente obrigado por responder meu post, mais deu um erro não funcionou não tipo meu ot tem 6 vocações , sorcerer , druid, knight , paladin , miner , elf tem como vc add ae ? Alguém ? Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1609670 Compartilhar em outros sites More sharing options...
0 Incur 30 Postado Janeiro 30, 2014 Share Postado Janeiro 30, 2014 Qual o id delas? Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610191 Compartilhar em outros sites More sharing options...
0 AdilsonHacker 98 Postado Janeiro 30, 2014 Autor Share Postado Janeiro 30, 2014 1 , 2 ,3 ,4 ,5 ,6 .. esses são os id das vocações iniciais , agora eu te pergunto depois que ele se promover ainda vai aparecer ele na lista ? Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610253 Compartilhar em outros sites More sharing options...
0 Shoguns 119 Postado Janeiro 30, 2014 Share Postado Janeiro 30, 2014 (editado) local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local vocationCount = { [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0, [6] = 0, } 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 local voc = getPlayerVocation(pid) if voc > 6 then voc = voc-6 end vocationCount[voc] = vocationCount[voc] + 1 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) .. " jogadores online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end str = str .. " \n"..vocationCount[1].." sorcerers, "..vocationCount[2].." druids, "..vocationCount[3].." paladins, "..vocationCount[4].." knights, "..vocationCount[5].." miner, "..vocationCount[6].." elf jogando agora." doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Editado Janeiro 30, 2014 por Shoguns Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610260 Compartilhar em outros sites More sharing options...
0 AdilsonHacker 98 Postado Janeiro 30, 2014 Autor Share Postado Janeiro 30, 2014 (editado) Deu o mesmo erro cara , não funfa de jeito nenhum ! Esse script aki funfa é quase igual acho que vc pode dar uma editadinha! local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local sorc,druid,paladin,knight,rook = 0,0,0,0,0 local i, position = 1, 1 local added = false for _, pid in ipairs(players) do -- Implementacion por Xafterin. if isSorcerer(pid) then sorc = sorc + 1 elseif isDruid(pid) then druid = druid + 1 elseif isPaladin(pid) then paladin = paladin + 1 elseif isKnight(pid) then knight = knight + 1 end --- 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 on OT Server:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights and ".. rook .." rookies." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Editado Janeiro 30, 2014 por AdilsonTsunami Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610295 Compartilhar em outros sites More sharing options...
0 Shoguns 119 Postado Janeiro 30, 2014 Share Postado Janeiro 30, 2014 local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local sorc,druid,paladin,knight,miner,elf = 0,0,0,0,0,0 local i, position = 1, 1 local added = false for _, pid in ipairs(players) do -- Implementacion por Xafterin. if isSorcerer(pid) then sorc = sorc + 1 elseif isDruid(pid) then druid = druid + 1 elseif isPaladin(pid) then paladin = paladin + 1 elseif isKnight(pid) then knight = knight + 1 end --- 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 on OT Server:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights ".. miner .." miners and ".. elf .." elfs." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610296 Compartilhar em outros sites More sharing options...
0 AdilsonHacker 98 Postado Janeiro 30, 2014 Autor Share Postado Janeiro 30, 2014 (editado) Pegou mano. Reputado Por Ajudar mais tem um defeito... o script só ta lendo knight , sorcs ,druid,paladin .. miner e elf ele não ta lento nao . quando logo um elf diz que nao tem nenhum! Acho que você esqueceu de editar essa parte : local i, position = 1, 1 local added = false for _, pid in ipairs(players) do -- Implementacion por Xafterin. if isSorcerer(pid) then sorc = sorc + 1 elseif isDruid(pid) then druid = druid + 1 elseif isPaladin(pid) then paladin = paladin + 1 elseif isKnight(pid) then knight = knight + 1 Editado Janeiro 30, 2014 por AdilsonTsunami Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610304 Compartilhar em outros sites More sharing options...
0 Killua 389 Postado Janeiro 30, 2014 Share Postado Janeiro 30, 2014 Leia meus comentários no código local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, channel) local players = getPlayersOnline() local strings = {""} local sorc,druid,paladin,knight,miner,elf = 0,0,0,0,0,0 local i, position = 1, 1 local added = false for _, pid in ipairs(players) do -- Implementacion por Xafterin. if isSorcerer(pid) then sorc = sorc + 1 elseif isDruid(pid) then druid = druid + 1 elseif isPaladin(pid) then paladin = paladin + 1 elseif isKnight(pid) then knight = knight + 1 elseif isInArray({5, 5}, getPlayerVocation(pid)) then -- Coloque o id da voc miner, id da voc promote miner miner = miner + 1 elseif isInArray({6, 6}, getPlayerVocation(pid)) then -- Coloque o id da voc elf, id da voc promote elf elf = elf + 1 end --- 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 on OT Server:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights ".. miner .." miners and ".. elf .." elfs." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610317 Compartilhar em outros sites More sharing options...
0 AdilsonHacker 98 Postado Janeiro 31, 2014 Autor Share Postado Janeiro 31, 2014 Valeu ae pela ajuda galera! Resolvido! Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610580 Compartilhar em outros sites More sharing options...
0 Killua 389 Postado Janeiro 31, 2014 Share Postado Janeiro 31, 2014 (editado) Tópico movido para a seção de dúvidas e pedidos resolvidos. Editado Janeiro 31, 2014 por Killua Link para o comentário https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/#findComment-1610584 Compartilhar em outros sites More sharing options...
Pergunta
AdilsonHacker 98
Eai Galera suave ? bom vim aqui pedir a ajuda de vocês .. preciso de um script !online diferente que ele funcione normalmente só que no final apareça tipo isso .
EXEMPLO / IMAGEM :
Desde já , agradeço !
Link para o comentário
https://xtibia.com/forum/topic/227839-talkactions-sistema-online-diferente/Compartilhar em outros sites
11 respostass a esta questão
Posts Recomendados