C++ Skull system 0.3.7 8.1

3alola1

I don't have time
Joined
Sep 2, 2010
Messages
397
Reaction score
49
Location
House
Hello guys I need to compile a skull system mod which when player for an example get 10 frags a white skull apears and 40 frag red green .. yellow .. red .. black

But no losing items or losing this skull it is like make people know that this player killed many players
 

Mustafa1337

Î Àm ŁĕğẹňĎ
Joined
Mar 4, 2017
Messages
89
Reaction score
18
Location
Egypt
You need to source edit exactly following this tutorial and also
Search for SKULL_BLACK in combat.cpp, player.cpp & spells.cpp
Remove all lines including SKULL_BLACK, to remove all black skulls restrictions
Feature - Every changes you need to a Hardcore/War Server (https://otland.net/threads/every-changes-you-need-to-a-hardcore-war-server.132897/)
and then follow this tutorial source edits to keep skulls when players lose PZ/battle
Solved - Skullsystem Skull Dissapears (https://otland.net/threads/skullsystem-skull-dissapears.233997/)
then you can use this MOD for skulls
XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="" enabled="yes">
<config name="SkullC_func"><![CDATA[

function setSkullColor(cid)
local t = {
[{10,20}] = 1,
[{20,40}] = 2,
[{40,70}] = 3,
[{70,110}] = 4,
[{110,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>
 
Top