Ir para conteúdo
  • 0

Ajuda Com Online Mostrar Resets Feito Pelo Vodkart


KennyConrad

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0

acho que assim funciona

 

function onSay(cid, words, param, channel)
function getPlayerReset(cid)
local query = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid))
return query:getDataInt("reset") <= 0 and 0 or query:getDataInt("reset")
end
       local showGamemasters,on,count,players,str = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),getPlayersOnline(),0,{},""
       for _, cid in pairs(on) do
               if getPlayerAccess(cid) < 3 then
                       count = count + 1
                       str = str..""..getPlayerName(cid).." (" .. getPlayerLevel(cid) .. ") ["..getResets(cid).."]"..(count ~= #on and ", " or ".")
               end
       end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,(showGamemasters == true and #on or count).." player(s) online.\n\n"..str)
end

Link para o comentário
Compartilhar em outros sites

  • 0

vodkartizin não funcionou mais deixa pra lá ja consegui fazer aki rsrs =)

 

puz assim

 


local config = {
showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}

function getResets(cid)
local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid))
return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end

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) .. " level (" .. getPlayerLevel(pid) .. ")  [".. getResets(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

e funcionou =)

 

resolvido topico reportado para moverem

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

×
×
  • Criar Novo...