Ir para conteúdo
  • 0

(Talkaction)!online Diferente


LeoXder

Pergunta

11 respostass a esta questão

Posts Recomendados

  • 0
function onSay(cid, words, param, channel)
       local showGamemasters,on,count = false,getPlayersOnline(),0
       for _, cid in pairs(on) do
               if getPlayerAccess(cid) < 3 then
                       count = count + 1
               end
       end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,(showGamemasters == true and #on or count).." player(s) online.")
end

Link para o comentário
Compartilhar em outros sites

  • 0

Na pasta talkactions do seu ot, crie um arquivo lua chamado online, e coloque isso dentro:

 

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,22, (i - 1) .. " jogador(s) online no servidor!")

for i, str in ipairs(strings) do

if(str:sub(str:len()) ~= ",") then

str = str .. "."

end

end

return TRUE

end

 

a tag que vai no xml é essa:

 

<talkaction words="!online" event="script" value="online.lua"/>

 

Caso eu tenha ajudado, +REP :))

Editado por GuizitoG
Link para o comentário
Compartilhar em outros sites

  • 0

[08/09/2012 16:53:58] Lua Script Error: [TalkAction Interface]

[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:onSay

 

[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:19: attempt to call global 'getPlayerGhostAccess' (a nil value)

[08/09/2012 16:53:58] stack traceback:

[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:19: in function <data/talkactions/scripts/online.lua:4>

Link para o comentário
Compartilhar em outros sites

  • 0
function onSay(cid, words, param, channel)
       local showGamemasters,on,count = false,getPlayersOnline(),0
       for _, cid in pairs(on) do
               if getPlayerAccess(cid) < 3 then
                       count = count + 1
               end
       end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,(showGamemasters == true and #on or count).." player(s) online.")
end

Link para o comentário
Compartilhar em outros sites

  • 0

GuizitoG o seu script n funcionou :(

 

Vodkart eu keria que tb aparecece na tela do jogador em verde a msm coisa que aparece no default

 

 

function onSay(cid, words, param, channel)
	local showGamemasters,on,count = false,getPlayersOnline(),0
	for _, cid in pairs(on) do
			if getPlayerAccess(cid) < 3 then
					count = count + 1
			end
	end
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,(showGamemasters == true and #on or count).." player(s) online.")
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,(showGamemasters == true and #on or count).." player(s) online.")
end

 

Dúvida Sanada

 

edit

 

Vodkart ta on o.O nem mostra aqui em baixo kkk

Editado por notle2012
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...