que comando é esse? que eu saiba só existia o comando !frags
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

É a mesma função, só que eu uso e não esta aparecendo os frags do jogador.
Script abaixo.
function onSay(cid, words, param, channel)
if(not getBooleanFromString(getConfigValue('useFragHandler'))) then
return false
end
local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}
local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {
name = result:getDataString("name"),
level = result:getDataInt("level"),
date = result:getDataInt("date")
}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end
local size = {
day = table.maxn(contents.day),
week = table.maxn(contents.week),
month = table.maxn(contents.month)
}
if(getBooleanFromString(getConfigValue('advancedFragList'))) then
local result = "Frags gained today: " .. size.day .. "."
if(size.day > 0) then
for _, content in ipairs(contents.day) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
if(size.week > 0) then
for _, content in ipairs(contents.week) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
if(size.month > 0) then
for _, content in ipairs(contents.month) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
end
doPlayerPopupFYI(cid, result)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Informações sobre o sistema de frags do AtrixBR:\n-\nPara pegar Red Skull:\n3 frags em um dia ou 14 frags em um semana ou 30 frags em um mês.\n-\nPara pegar Black Skull:\n6 frags em um dia ou 28 frags em um semana ou 60 frags em um mês.\n-\n* Não é banido por excesso de frags.\n-\nA Red Skull expira em 7 dias e a Black Skull em 14 dias.\n \n")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Caso queira retirar frags, red ou black skull mais rápido você pode utilizar os comandos !comprar removerfrag, !comprar removerredskull, !comprar removerblackskull mediante a cobrança de barras de ouro.\n \n \n \n")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No momento você tem " .. size.day .. " frags de hoje, " .. (size.day + size.week) .. " desta semana e " .. (size.day + size.week + size.month) .. " deste mês.")
if(size.day > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu último frag foi em " .. os.date("%d %B %Y %X", contents.day[1].date) .. " com o jogador " .. contents.day[1].name .. " que estava no level " .. contents.day[1].level .. " no momento de sua morte.")
end
local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull vai acabar dia " .. os.date("%d %B %Y %X", skullEnd))
end
end
return true
end
--Edit--
Eu coloquei para aparecer a tabela no meu config.lua e mesmo assim não aparece a contagem de frags.
Editado Maio 11 por Koama
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

estranho, oque eu tenho aqui funciona normalmente, vou até passar pra você, ai testa...
local config = {
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}
function onSay(cid, words, param, channel)
if(not config.useFragHandler) then
return false
end
local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}
local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {
name = result:getDataString("name"),
level = result:getDataInt("level"),
date = result:getDataInt("date")
}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end
local size = {
day = table.maxn(contents.day),
week = table.maxn(contents.week),
month = table.maxn(contents.month)
}
if(config.advancedFragList) then
local result = "Frags gained today: " .. size.day .. "."
if(size.day > 0) then
for _, content in ipairs(contents.day) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
if(size.week > 0) then
for _, content in ipairs(contents.week) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
if(size.month > 0) then
for _, content in ipairs(contents.month) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end
result = result .. "\n"
end
local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
end
doPlayerPopupFYI(cid, result)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
if(size.day > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
end
local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
end
end
return true
end
Vodkart
Estou achando que tem que mecher em alguma configuração no ot, sabe me dizer aonde pode ser?
A contagem dos frags não estão funcionando....
Edit--
Seu script pegou normalmente, mas quando eu mato um jogador no server não faz a contagem de frags. Como eu falei a cima acho que é o server que não esta fazendo contagem de frags.
No Ot tem um sistema que aparece uma tabelinha tipo esse teu script, não esta fazendo contagem também ![]()
Editado Maio 11 por Koama
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

é em config.lua
Meu Config.lua
Troquei o Soucer do servidor.
pode fechar o tópico erro arrumado.
Editado Maio 11 por Koama




info
Grupo: Campones
Registrado: 27/06/11
Posts: 91
Reputação: +5
Eu uso o comando !kills e não aparece os frags que eu tenho, fica sempre 0, alguem pode me ajudar com isso?
Grato. Rep++ para quem ajudar.
Editado Maio 11 por Koama