Dois tópicos iguais.
Por Lucasming, 21 de out. de 2012 em Scripts
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Editado Outubro 21 por Skymagnum
Já aconteceu isso comigo, no meu caso funcionou trocando o config.lua
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming

Já aconteceu isso comigo, no meu caso funcionou trocando o config.lua
Aki não Funcionou nada, Troquei e esta do mesmo Jeito ![]()
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

tente por assim no seu config.lua
useFragHandler = true advancedFragList = false
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming

tente por assim no seu config.lua
useFragHandler = true advancedFragList = false
Já Esta Assim... Ainda Continua sem Contar os Frags...
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Lucasming talvez o erro esta no script que verifica o frags
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming

Data/Talkactions/Scripts
Frags.lua
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
Config.lua
-- Unjustified kills-- NOTE: *Banishment and *BlackSkull variables are >summed up<
-- (dailyFragsToRedSkull + dailyFragsToBanishment) with their
-- *RedSkull equivalents.
-- Auto banishing works only if useBlackSkull set to negative.
-- advancedFragList is not advised if you use huge frags
-- requirements.
useFragHandler = true
redSkullLength = 3 * 24 * 60 * 60
blackSkullLength = 7 * 24 * 60 * 60
dailyFragsToRedSkull = 5
weeklyFragsToRedSkull = 25
monthlyFragsToRedSkull = 100
dailyFragsToBlackSkull = dailyFragsToRedSkull
weeklyFragsToBlackSkull = weeklyFragsToRedSkull
monthlyFragsToBlackSkull = monthlyFragsToRedSkull
dailyFragsToBanishment = dailyFragsToRedSkull
weeklyFragsToBanishment = weeklyFragsToRedSkull
monthlyFragsToBanishment = monthlyFragsToRedSkull
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = true
advancedFragList = false
Editado Outubro 21 por Lucasming
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

troque o useblack skull e o advance por isso
useBlackSkull = true useFragHandler = true advancedFragList = false
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Acho que dá pra fazer um sistema de frag por lua usando como base esse script que montei agorinha com uma função que achei na net:
function doPlayerAddFrags(cid, amount)
return doPlayerSetRedSkullTicks(cid, getPlayerRedSkullTicks(cid) + getConfigInfo('timeToDecreaseFrags') * amount)
end
function onKill(cid, target)
if isPlayer(target) then
if getPlayerSkullType(target) == SKULL_WHITE then
else
doPlayerAddFrag(cid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! The murder of "..getCreatureName(target).." was not justified.")
end
end
return true
end
Editado Outubro 21 por LuckOake
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming

troque o useblack skull e o advance por isso
useBlackSkull = true useFragHandler = true advancedFragList = false
É para trocar no que esta Dentro do Frags.lua ?
@LockOake
Acho que dá pra fazer um sistema de frag por lua usando como base esse script que montei agorinha com uma função que achei na net:
function doPlayerAddFrags(cid, amount) return doPlayerSetRedSkullTicks(cid, getPlayerRedSkullTicks(cid) + getConfigInfo('timeToDecreaseFrags') * amount) end function onKill(cid, target) if isPlayer(target) then if getPlayerSkullType(target) == SKULL_WHITE then else doPlayerAddFrag(cid, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! The murder of "..getCreatureName(target).." was not justified.") end end return true end
Não Entendi, me explique mais pf ![]()
Editado Outubro 21 por Lucasming
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

@Lucasming
Tenta o seguinte, vai na pasta creaturescripts:
creaturescripts.xml:
<event type="kill" name="Fragging" script="frags.lua"/>
frags.lua:
function doPlayerAddFrags(cid, amount)
return doPlayerSetRedSkullTicks(cid, getPlayerRedSkullTicks(cid) + getConfigInfo('timeToDecreaseFrags') * amount)
end
function onKill(cid, target)
if isPlayer(target) then
if getPlayerSkullType(target) == SKULL_WHITE then
else
doPlayerAddFrag(cid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! The murder of "..getCreatureName(target).." was not justified.")
end
end
return true
end
Adicione em login.lua antes do último return true:
registerCreatureEvent(cid, "Fragging")
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming

Agora Quando Mato Alguem!
Ele fica com 0 de Life, e não Reloga, Não Faz mais NadaDa Muitos Erros no Log do Servidor (Telinha do Servidor)
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Tá, mas posta o erro ou tira uma print pra eu saber onde arrumar.
info
Grupo: Campones
Registrado: 30/11/08
Posts: 13
Reputação: 0
Char no Tibia: lucas ming
Boa tarde Pessoal do Xtibia,
Meu servidor é o "Baiak Extreme Otprojects 0.2.1".
Só falta mais uam Coisinha para colocar ele ONLINE!
É o Sistema de Frag, não ta Funcionando, Mato Player Injustamente, e não Ganho Frag!
Já Fiz:
Só Preciso Arrumar isso, Conto com Vocês.
Só preciso de Mais isso pra Colocar Online.
Desde Já! Agradeço a Todos
Dou REP +, pra quem ajudar-me

Valeeeu