Ir para conteúdo
  • 0

[Help] Ajudem com erro Por Favor?


bernardes22

Pergunta

Boa Noite Amigos Do XTibia!!

Estou extremamente desesperado... esta aparecendo um erro em meu distro e não estou conseguindo resolver esse erro de jeito nenhum, alguém por favor poderia me ajudar? irei posta o erro que aparece na Distro e os arquivos .lua

Estou Usando o TFS 0.4 Versão do server 8.6

Erro que aparece na Distro

[02/03/2016 17:32:36] [Error - CreatureScript Interface] 
[02/03/2016 17:32:36] In a timer event called from: 
[02/03/2016 17:32:36] data/creaturescripts/scripts/login.lua:onLogin
[02/03/2016 17:32:36] Description: 
[02/03/2016 17:32:36] (luaGetThingPosition) Thing not found


[02/03/2016 17:32:36] [Error - CreatureScript Interface] 
[02/03/2016 17:32:36] In a timer event called from: 
[02/03/2016 17:32:36] data/creaturescripts/scripts/login.lua:onLogin
[02/03/2016 17:32:36] Description: 
[02/03/2016 17:32:36] (internalGetPlayerInfo) Player not found when requesting player info #6


[02/03/2016 17:32:36] [Error - CreatureScript Interface] 
[02/03/2016 17:32:36] In a timer event called from: 
[02/03/2016 17:32:36] data/creaturescripts/scripts/login.lua:onLogin
[02/03/2016 17:32:36] Description: 
[02/03/2016 17:32:36] (internalGetPlayerInfo) Player not found when requesting player info #6


[02/03/2016 17:32:36] [Error - CreatureScript Interface] 
[02/03/2016 17:32:36] In a timer event called from: 
[02/03/2016 17:32:36] data/creaturescripts/scripts/login.lua:onLogin
[02/03/2016 17:32:36] Description: 
[02/03/2016 17:32:36] (luaGetCreatureStorage) Creature not found


[02/03/2016 17:32:36] [Error - CreatureScript Interface] 
[02/03/2016 17:32:36] In a timer event called from: 
[02/03/2016 17:32:36] data/creaturescripts/scripts/login.lua:onLogin
[02/03/2016 17:32:36] Description: 
[02/03/2016 17:32:36] data/lib/Pivi.lua:34: attempt to compare number with boolean
[02/03/2016 17:32:36] stack traceback:
[02/03/2016 17:32:36] data/lib/Pivi.lua:34: in function <data/lib/Pivi.lua:19>

Arquivo Pivi.lua

function doUseGem(cid, item)  local voc = getPlayerVocation(cid)
  local interval = gems.interval[voc]


  if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return FALSE
  end


  setPlayerStorageValue(cid, gems.storage[voc], 1)
  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
  doRemoveItem(item.uid, 1)






  return TRUE  
end




function sendGemEffect(cid, storage, interval)
local pos = getThingPos(cid)
local voc = getPlayerVocation(cid)
local color = 1
if voc == 5 then
  color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)]
elseif voc == 6 then
  color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)]
elseif voc == 7 then
  color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)]
elseif voc == 8 then
  color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)]
end


doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) >= 1 then 
    addEvent(sendGemEffect, interval, cid, storage, interval)
  end
end


function doRemoveGemEffect(cid)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) < 1 then
    return FALSE
  end
  setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)], 0)
  return TRUE
end


function doRemoveAllGemEffect(cid)
  for i = 1, table.maxn(gms.storage) do
    setPlayerStorageValue(cid, gems.storage[i], 0)
  end
  return TRUE
end


function isGemActivated(cid)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then
    return TRUE
  end
  return FALSE
end

Arquivo Login.lua

function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)
local voc = getPlayerVocation(cid)
if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then
sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
end
end


               registerCreatureEvent(cid, "owned")
               registerCreatureEvent(cid, "conected")
               registerCreatureEvent(cid, "boss")
               registerCreatureEvent(cid, "thalasteleport")
               registerCreatureEvent(cid, "thalas_teleport")
               doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
               registerCreatureEvent(cid, "zombieevent")
               registerCreatureEvent(cid, "combat")
               registerCreatureEvent(cid, "forever amulet")
return TRUE
end

 

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0
function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)

Dê espaço entre isso...

function onLogin(cid)
setPlayerStorageValue(cid, 47112120, 2)
Link para o comentário
Compartilhar em outros sites

  • 0
function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)

Dê espaço entre isso...

function onLogin(cid)
setPlayerStorageValue(cid, 47112120, 2)

 

 

agora apareceu outro erro na distro

 

[04/03/2016 12:39:57] [Error - Action Interface] 
[04/03/2016 12:39:57] In a timer event called from: 
[04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse
[04/03/2016 12:39:57] Description: 
[04/03/2016 12:39:57] (luaGetThingPosition) Thing not found


[04/03/2016 12:39:57] [Error - Action Interface] 
[04/03/2016 12:39:57] In a timer event called from: 
[04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse
[04/03/2016 12:39:57] Description: 
[04/03/2016 12:39:57] (internalGetPlayerInfo) Player not found when requesting player info #6


[04/03/2016 12:39:57] [Error - Action Interface] 
[04/03/2016 12:39:57] In a timer event called from: 
[04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse
[04/03/2016 12:39:57] Description: 
[04/03/2016 12:39:57] (internalGetPlayerInfo) Player not found when requesting player info #6


[04/03/2016 12:39:57] [Error - Action Interface] 
[04/03/2016 12:39:57] In a timer event called from: 
[04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse
[04/03/2016 12:39:57] Description: 
[04/03/2016 12:39:57] (luaGetCreatureStorage) Creature not found


[04/03/2016 12:39:57] [Error - Action Interface] 
[04/03/2016 12:39:57] In a timer event called from: 
[04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse
[04/03/2016 12:39:57] Description: 
[04/03/2016 12:39:57] data/lib/Pivi.lua:34: attempt to compare number with boolean
[04/03/2016 12:39:57] stack traceback:
[04/03/2016 12:39:57]  data/lib/Pivi.lua:34: in function <data/lib/Pivi.lua:19>

Arquivo gems.lua

 

local config =
{
 minLevel = 200, -- Level mínimo para adquirir a gema.
 }


function onUse(cid, item, fromPosition, itemEx, toPosition)
 if getPlayerLevel(cid) >= config.minLevel then
  gem = gems.id[getPlayerVocation(cid)]
  if item.itemid == gem then
    doUseGem(cid, item, getPlayerVocation(cid))
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você adquiriu uma gema espíritual.")
      doSendMagicEffect(getCreaturePosition(cid), 65)
     end
    else
   doPlayerSendCancel(cid, "Voc\ê precisa ser level "..config.minLevel.." para adquirir a gema esp\íritual.")
  end
  return TRUE
end

 

Link para o comentário
Compartilhar em outros sites

  • 0

posta sua lib das gems.

Tópico Movido

Este tópico foi movido de "OTServScriptingDownloads ScriptsSistemas e mods"

para "OTServScriptingSuporte Scripting".

 

 

 

 

ta aqui amigo

 

data/lib/gems.lua

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
  gem = gems.id[getPlayerVocation(cid)]
  if item.itemid == gem then
    doUseGem(cid, item, getPlayerVocation(cid))
  end
  return TRUE
end

data/lib/pivi.lua

 

function doUseGem(cid, item)
  local voc = getPlayerVocation(cid)
  local interval = gems.interval[voc]


  if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
    return FALSE
  end


  setPlayerStorageValue(cid, gems.storage[voc], 1)
  sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
  doRemoveItem(item.uid, 1)






  return TRUE  
end




function sendGemEffect(cid, storage, interval)
local pos = getThingPos(cid)
local voc = getPlayerVocation(cid)
local color = 1
if voc == 5 then
  color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)]
elseif voc == 6 then
  color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)]
elseif voc == 7 then
  color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)]
elseif voc == 8 then
  color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)]
end


doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) >= 1 then 
    addEvent(sendGemEffect, interval, cid, storage, interval)
  end
end


function doRemoveGemEffect(cid)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) < 1 then
    return FALSE
  end
  setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)], 0)
  return TRUE
end


function doRemoveAllGemEffect(cid)
  for i = 1, table.maxn(gms.storage) do
    setPlayerStorageValue(cid, gems.storage[i], 0)
  end
  return TRUE
end


function isGemActivated(cid)
  if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then
    return TRUE
  end
  return FALSE
end

data/lib/Pivi_const.lua

 

gems = {
id = {2156, 2155, 2154, 2153, 2156, 2155, 2154, 2156},
storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008},
interval = {600, 600, 600, 600, 600, 600, 600}, -- Intervalo dos efeitos
}
gemMsg = {
rnd = {"´ . ,", ". ´ ,", "` . ,", ", ´ ."},
colorDruid = {182,213},
colorSorcerer = {215,215},
colorPaladin = {89,89},
colorKnight = {210,210},
colorElderDruid = {182,213},
colorMasterSorcerer = {215,215},
colorRoyalPaladin = {89,89},
colorEliteKnight = {210,210}
}


Amigo já postei os arquivos da pasta lib.

posta sua lib das gems.

Tópico Movido

Este tópico foi movido de "OTServScriptingDownloads ScriptsSistemas e mods"

para "OTServScriptingSuporte Scripting".

 

 

 

Você me Abandonou cara :sad: :mellow:

Link para o comentário
Compartilhar em outros sites

  • 0

Não manjo de derivados... Mas, aqui vai minha tentativa:

gems.lua:

local config =
{
 minLevel = 200, -- Level mínimo para adquirir a gema.
 }


function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= config.minLevel then
gem = gems.id[getPlayerVocation(cid)]
	if item.itemid == gem then
	plVoc = getPlayerVocation(cid)
    doUseGem(cid, item, plVoc)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você adquiriu uma gema espíritual.")
		if isPlayer(cid) then
		posi = getPlayerPosition(cid)
		 doSendMagicEffect(posi, 65)
		 else
		 posie = getCreaturePosition(cid)
		 doSendMagicEffect(posie, 65)
		 end
    end
else
doPlayerSendCancel(cid, "Você precisa ser level "..config.minLevel.." para adquirir a gema espíritual.")
end
return true
end
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...