Ir para conteúdo

Featured Replies

Postado
8 minutos atrás, Andersen96 disse:

@Lyu Perfeito !!! Se poder me ajudar em uma ultima coisinha agradeço...
 

  Mostrar conteúdo oculto

function onKill(cid, target, lastHit)
    
    if(getPlayerFrags(cid) >= 5 and getPlayerFrags(cid) < 6) and getPlayerStorageValue(cid, 7000) ~= 1 then
        doCreatureSetSkullType(cid, 2)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Green Skull! You have killed 500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 500 players, he received the emblem - Green Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7000, 1)
    elseif(getPlayerFrags(cid) >= 7 and getPlayerFrags(cid) < ? and getPlayerStorageValue(cid, 7001) ~= 1 then
        doCreatureSetSkullType(cid, 3)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained White Skull! You have killed 2500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 2500 players, he received the emblem - White Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7001, 1)
    elseif(getPlayerFrags(cid) >= 9 and getPlayerFrags(cid) < 10) and getPlayerStorageValue(cid, 7002) ~= 1 then
        doCreatureSetSkullType(cid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Yellow Skull! You have killed 5000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 5000 players, he received the emblem - Yellow Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7002, 1)
    elseif(getPlayerFrags(cid) >= 11 and getPlayerFrags(cid) < 100000) and getPlayerStorageValue(cid, 7003) ~= 1 then
        doCreatureSetSkullType(cid, 4)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Red Skull! You have killed 10000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 10000 players, he received the emblem - Red Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7003, 1)
    end
    return true
end

Este script era pra trocar o SKULL quando avançasse os FRAGS requerido, ou seja.. EX: tenho 6 frags que é TYPESKULL: 2 quando mato um player deveria trocar para a caveira de FRAGS 7 que seria a TYPE: 1 .. Mas não está trocando após chegar nos frags requeridos. 

 

tem que ver se o player não possui a storage referente, senão ele não recebe. Porque reparei aqui que está bloqueado para receber as skulls somente uma vez (storage), a não ser que, esteja manipulando essa storage a partir de outro script.

  • Respostas 8
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Procurei a função aqui, não testei, mas adicione-a em data/lib/050-function.lua e veja se resolve o seu problema. function getPlayerFrags(cid) local time = os.time() local times = {today = (time

  • Está faltando a função getPlayerFrags.

  • @Andersen96 Setá conforme o nome .. SKULL_WHITE , SKULL_YELLOW , SKULL_RED , SKULL_BLACK .. você pode usar em mods seria até melhor  PS: é do skyforever , você não falo qual versão era e tal

Posted Images

Postado
1 hora atrás, Andersen96 disse:

@Lyu Perfeito !!! Se poder me ajudar em uma ultima coisinha agradeço...
 

  Mostrar conteúdo oculto

function onKill(cid, target, lastHit)
    
    if(getPlayerFrags(cid) >= 5 and getPlayerFrags(cid) < 6) and getPlayerStorageValue(cid, 7000) ~= 1 then
        doCreatureSetSkullType(cid, 2)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Green Skull! You have killed 500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 500 players, he received the emblem - Green Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7000, 1)
    elseif(getPlayerFrags(cid) >= 7 and getPlayerFrags(cid) < ? and getPlayerStorageValue(cid, 7001) ~= 1 then
        doCreatureSetSkullType(cid, 3)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained White Skull! You have killed 2500 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 2500 players, he received the emblem - White Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7001, 1)
    elseif(getPlayerFrags(cid) >= 9 and getPlayerFrags(cid) < 10) and getPlayerStorageValue(cid, 7002) ~= 1 then
        doCreatureSetSkullType(cid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Yellow Skull! You have killed 5000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 5000 players, he received the emblem - Yellow Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7002, 1)
    elseif(getPlayerFrags(cid) >= 11 and getPlayerFrags(cid) < 100000) and getPlayerStorageValue(cid, 7003) ~= 1 then
        doCreatureSetSkullType(cid, 4)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation! You gained Red Skull! You have killed 10000 players.")
        doBroadcastMessage("CONGRATULATIONS! ".. getCreatureName(cid) .." killed 10000 players, he received the emblem - Red Skull!", MESSAGE_STATUS_CONSOLE_RED)
        setPlayerStorageValue(cid, 7003, 1)
    end
    return true
end

Este script era pra trocar o SKULL quando avançasse os FRAGS requerido, ou seja.. EX: tenho 6 frags que é TYPESKULL: 2 quando mato um player deveria trocar para a caveira de FRAGS 7 que seria a TYPE: 1 .. Mas não está trocando após chegar nos frags requeridos. 

 

 

@KotZletY @xWhiteWolf

Postado

@Andersen96 Setá conforme o nome .. SKULL_WHITE , SKULL_YELLOW , SKULL_RED , SKULL_BLACK ..

você pode usar em mods seria até melhor 

PS: é do skyforever , você não falo qual versão era e tals 

 

Skullsystem.xml

<?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 = {
      [{15,29}] = SKULL_WHITE,
      [{30,49}] = SKULL_YELLOW,
      [{50,89}] = SKULL_WHITE,
      [{90,149}] = SKULL_RED,
      [{150,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>

 

Vale lembrar você deve remover seu sistema antigo.

 

 

 

Editado por Celulose (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo