LU

[Encerrado] [Encerrado] Skull System

Por ludgeromf1, 26 de out. de 2017 em Tópicos Sem Resposta

5
984
ludgeromf1L
26 de outubro de 2017 às 09:25

Fala galera blz entao seguinte queria duas coisas... 

Primeira e um sistema de skull pra servidor de war achei um no site aqui mais ele buga queria que quando player atacasse nao virasse pk ele somente pegasse pz e ao matar x player pegar a skull e assim por diante. 

Segunda duvida e a seguinte no ot de war e aquele que muda de mapa famoso xdream na pasta lib la tem os script que muda de mapa queria saber como faco pra adicionar mais mapas vi la que tem town id mas ao entendi muito bem nao... 

Desde ja agradeço

lSaintyL
26 de outubro de 2017 às 19:36

Na pasta "Mods" crie um arquivo chamado "Skull System.xml" e coloca esse código dentro:

Spoiler
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="google.com" enabled="yes">
<config name="SkullC_func"><![CDATA[
 
function setSkullColor(cid)
local t = {
[{5,10}] = 1,
[{11,15}] = 2,
[{16,20}] = 3,
[{21,25}] = 4,
[{26,math.huge}] = 5
}
for var, ret in pairs(t) do
if getPlayerFrags(cid) >= var[1] and getPlayerFrags(cid) <= var[2] then
doCreatureSetSkullType(cid, ret)
end
end
end
function getPlayerFrags(cid)
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 = {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)}
return size.day + size.week + size.month
end
]]></config>
<event type="login" name="SkullLogin" event="script"><![CDATA[
domodlib('SkullC_func')
function onLogin(cid)
registerCreatureEvent(cid, "ColorKill")
setSkullColor(cid)
return true
end]]></event>
<event type="kill" name="ColorKill" event="script"><![CDATA[
domodlib('SkullC_func')
function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) then
doCreatureSetSkullType(target, 0)
addEvent(setSkullColor, 100, cid)
end
return true
end]]></event>
</mod>

 

No seu "config.lua" procure por:

dailyFragsToRedSkull = 10
weeklyFragsToRedSkull = 40
monthlyFragsToRedSkull = 90

e troque por:

dailyFragsToBlackSkull = 9999999
weeklyFragsToBlackSkull = 9999999
monthlyFragsToBlackSkull = 9999999

Pronto, se não funcionar é só falar que eu tento ajudar!

 

Créditos pelo código: Skyforever (é de outro fórum)

Editado Outubro 26 por SirDubstep

ludgeromf1L
27 de outubro de 2017 às 19:39

ja usei ja e da a mesma coisa continua dando o bug

1 mês depois...
StigalS
29 de novembro de 2017 às 15:18
A questão neste tópico de suporte foi encerrada por falta de resposta. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta
FrenviusF
29 de novembro de 2017 às 15:19
A questão neste tópico de suporte foi encerrada por falta de resposta. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta