• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ TFS 0.4 rev3777 8.60 Skulls System

Addams

OTMadness.com OTSes Services
Staff member
Board Moderator
Joined
Sep 29, 2009
Messages
2,920
Solutions
342
Reaction score
1,688
Location
Egypt
I am doing war server, I have fix skulls system exactly as

and I removed some other black skull restrictions, everything is working properly but I don't know how to remove green_skull in party or guild-war
and also green/white/yellow skulls are disappearing as soon as PZ/battle gone then when I relog/kill a player they appear back due to onkill/login script.
Can someone help me removing green skull in party/guild-war and keep green/white/yellow skulls when PZ/battle time is finished?
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)
  if not isPlayer(cid) then
      return
  end
  local t = {
      [{50,100}] = SKULL_YELLOW,
      [{100,200}] = SKULL_GREEN,
      [{200,400}] = SKULL_WHITE,
      [{400,800}] = SKULL_RED,
      [{800,math.huge}] = SKULL_BLACK
  }
  local frags = getPlayerFrags(getPlayerGUID(cid))
  for var, ret in pairs(t) do
      if frags >= var[1] and frags <= var[2] then
          doCreatureSetSkullType(cid, ret)
      end
  end
end
function getPlayerFrags(guid)
   local result = db.getResult("SELECT COUNT(*) as count 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` = " .. guid)
   if(result:getID() ~= -1) then
      local count = result:getDataInt("count")
       result:free()
      return count
   end
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>
 
Last edited:
I have fixed the skulls disappearing by following this
and party green skull by following this
Thanks!
 
what other changes to blackskull did you make? i got everything working exept for blackskull still takes double damage cant summon creatures or use area spells
 
Back
Top