• 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!

Skull system

prav

New Member
Joined
Aug 6, 2014
Messages
61
Reaction score
0
Hey guys i have a skull system for my 8.6 sever however the skulls dont acctually show up for the top 10 levels something is bugged and i cant figure out what it is could someone take a look for me please?








rep++

Bump ;s
 
Last edited by a moderator:
how do you expect anyone to help when you don't provide code
it's like going to a restaurant and saying i want food but you dont tell them what kind of food you want
Bro im having an issue with something related, I need to know how i can make people keep pk after logout or when walk in pz
im working on a war ot 7.4 based on otx rev 3.0.77 and i need add this function....
someone told me that i need to edit this line in player.cpp but i cant get succes when compiling
Code:
Skulls_t Player::getSkull() const
{
if(hasFlag(PlayerFlag_NotGainInFight) || hasCustomFlag(PlayerCustomFlag_NotGainSkull))
return SKULL_NONE;

return skull;
}

somone told me also i need execute some tables in db but i dont know how can give me a joggy pls?


this is the thread that i've made to recieve support
Compiling - How edit this part of c++ code player.cpp? need keep pk whitout pz or when log out.
regards

Hey guys i have a skull system for my 8.6 sever however the skulls dont acctually show up for the top 10 levels something is bugged and i cant figure out what it is could someone take a look for me please?








rep++
i have a script similar works for me showing owned ! smashed messages but doesn't show skull gain(white red green etc..) and doesnt show neither xxx is on a killing spree has kill 5 player etc so i added this script and seccond is for skulls the messages to the whole server are nto working
Code:
local c = {
item = 2152, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 6) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 15) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 23) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 37) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
end

return true
end


for the skulls i use this

Code:
local storage = 9000

function onKill(cid, target, lastHit)
if cid ~= target and isPlayer(target) then
local a = math.max(0, getCreatureStorage(cid, storage)) + 1
doCreatureSetStorage(cid, storage, a)
if a == 6 then
doCreatureSetSkullType(cid, SKULL_GREEN)
elseif a == 15 then
doCreatureSetSkullType(cid, SKULL_YELLOW)
elseif a == 23 then
doCreatureSetSkullType(cid, SKULL_WHITE)
elseif a == 37 then
doCreatureSetSkullType(cid, SKULL_RED)
end
end
return true
end

and the message showing to the whole server xxx is on a killing sprre etc... are not working but i hope have helped you

also you have to source edit just google or in otland write source edit to have a war server

:)
regards
 
Last edited by a moderator:
i have a script similar works for me showing owned ! smashed messages but doesn't show skull gain(white red green etc..) and doesnt show neither xxx is on a killing spree has kill 5 player etc so i added this script and seccond is for skulls the messages to the whole server are nto working
Code:
local c = {
item = 2152, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 6) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 15) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 23) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 37) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
end

return true
end


for the skulls i use this

Code:
local storage = 9000

function onKill(cid, target, lastHit)
if cid ~= target and isPlayer(target) then
local a = math.max(0, getCreatureStorage(cid, storage)) + 1
doCreatureSetStorage(cid, storage, a)
if a == 6 then
doCreatureSetSkullType(cid, SKULL_GREEN)
elseif a == 15 then
doCreatureSetSkullType(cid, SKULL_YELLOW)
elseif a == 23 then
doCreatureSetSkullType(cid, SKULL_WHITE)
elseif a == 37 then
doCreatureSetSkullType(cid, SKULL_RED)
end
end
return true
end

and the message showing to the whole server xxx is on a killing sprre etc... are not working but i hope have helped you

also you have to source edit just google or in otland write source edit to have a war server

:)
regards
could create a globalevent that refreshes player skulls on an interval
dont need to source edit
 
could create a globalevent that refreshes player skulls on an interval
dont need to source edit
i need source edit to do not refesh skull i want to people is skulled with green,white,red..etc when log out, walk on pz zone or lost pz lock... will kept the skulls
 
sorry @Static_ i forgot to upload the script its a mod
the script is working properly but the plaayers never losses theirs skulls even if they log or die
i need that the player can lost skull when they die but keep it if they log out
here script /mod its for tfs 0.4-0.3.7
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">
<config name="SkullC_func"><![CDATA[
function setSkullColor(cid)
  if not isPlayer(cid) then
      return
  end
  local t = {
      [{1,2}] = SKULL_WHITE,
      [{3,4}] = SKULL_YELLOW,
      [{5,6}] = SKULL_GREEN,
      [{7,math.huge}] = SKULL_RED
  }
  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>
 
Back
Top