DE

[ Resolvido ]Talkactions Simples !online.

Por Dersinho, 07 de mai. de 2012 em Scripts

script
7
1k
DersinhoD
07 de maio de 2012 às 15:09

bom vim pediar a vcs que me ajudem Pressiso de um script de ver quem esta online no ot mais que so aparesece o Nome Sem Aparecer Level

E nem a Conta do Adm ou Alguem da staff tem como alguem conseguir esse script pra min..

 

no momento estou usando esse

 

 

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 getPlayerAccess(pid) < 3 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

 

 

agradeço xDD

jhon992J
07 de maio de 2012 às 16:36

tenta assim:

function onSay(cid, words, param, channel)
local players = getPlayersOnline()
local strings = ""
for i=1, #players do
   if getPlayerAccess(players[i]) < 3 then
       strings = strings .. ", " ..  getCreatureName(players[i])
   end
end
strings = strings .. "."
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player(s) online:")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, strings)
return true
end

 

obs: nem testei, qualquer erro me fala.

DersinhoD
07 de maio de 2012 às 17:02

blz pareco deu certo mais tem um problema nao esta parecendo quantos players tem online exemplo 36

tem como adicionar nesse script ?

VodkartV
07 de maio de 2012 às 17:13
function onSay(cid, words, param, channel)
count,str = 0,""
for _, cid in ipairs(getPlayersOnline()) do
if getPlayerAccess(cid) < 3 then
                 str = str.."".. (str == "" and "" or ",") ..""..getPlayerName(cid)
                 count = count + 1
                end
                end
             str = str.."."
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,count.." player(s) online:\n"..str)
return true
end

Editado Maio 7 por Vodkart

DersinhoD
07 de maio de 2012 às 17:20

vlw vodka sempre me ajudando em seu rep ta guardado ja dei rep pro paraceri ali em cima pela ajuda vlw abraço!

jhon992J
07 de maio de 2012 às 17:32

Tópico resolvido, reportado para moverem.

Editado Maio 7 por Jhon992

alldakieA
08 de maio de 2012 às 17:39

Resolvido,

Movido para "Pedidos e Dúvidas de Scripts Atendidos".