Como mandado via pm:
Aqui está:
function onSay(cid, words, param)
local player = Player(cid)
local hasAccess = player:getGroup():getAccess()
local players = Game.getPlayers()
local playerCount = Game.getPlayerCount()
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online:")
local i = 0
local msg = ""
for k, tmpPlayer in ipairs(players) do
function getPlayerResets(cid)
local resultId = db.storeQuery('SELECT `resets` FROM `players` WHERE id='..tmpPlayer:getGuid()..'')
if resultId ~= false then
local resetes = result.getDataInt(resultId, "resets")
result.free(resultId)
return resetes
end
return false
end
if hasAccess or not tmpPlayer:isInGhostMode() then
if i > 0 then
msg = msg .. ", "
end
msg = msg .. tmpPlayer:getName() .. " (" .. tmpPlayer:getLevel() .. ") {" .. getPlayerResets(tmpPlayer) .. "}"
i = i + 1
end
if i == 10 then
if k == playerCount then
msg = msg .. "."
else
msg = msg .. ","
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
msg = ""
i = 0
end
end
if i > 0 then
msg = msg .. "."
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
end
return false
end
Tópico movido para dúvidas / pedidos resolvidos.


info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea
Olá galera do XT;
Desde já agradeço por todas as dúvidas que tiraram minhas e elogiar o Xtibia por ter tantas pessoas que ajudam em troca de nada apenas de um obrigado. :XTibia_smile::smile_positivo:Enfim é isso e vamos a mais uma dúvida minha.
É o seguinte eu possuo o script online que mostra reset mas apenas funciona para sistema de sto, o meu é por DB ja tentei alterar só que da uns erros que não consegui arrumar e espero que vocês me ajudem.
Segue o script:
TFS: 1.2
Versão: 10.9
function onSay(cid, words, param) local player = Player(cid) local hasAccess = player:getGroup():getAccess() local players = Game.getPlayers() local playerCount = Game.getPlayerCount() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online:") local i = 0 local msg = "" for k, tmpPlayer in ipairs(players) do local function getPlayerResets() local resets = tmpPlayer:getStorageValue(500) return resets < 0 and 0 or resets end if hasAccess or not tmpPlayer:isInGhostMode() then if i > 0 then msg = msg .. ", " end msg = msg .. tmpPlayer:getName() .. " (" .. tmpPlayer:getLevel() .. ") {" .. getPlayerResets() .. "}" i = i + 1 end if i == 10 then if k == playerCount then msg = msg .. "." else msg = msg .. "," end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) msg = "" i = 0 end end if i > 0 then msg = msg .. "." player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg) end return false end