[Resolvido] Erro urgente eventos

DavyziinC
em Resolvidos

DavyziinC

Sou Pica néguim
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 07/02/12Posts: 207Char no Tibia: Não lembro :(

Bom dia tk. estou com um erro no meu servidor que nao estou consigo resolver . Tipo eu instalei todos os eventos , CTF , Snawball , Island of Elementals tudo certinho  nao aparece nenhum erro no distro só que eu boto o dia e o horario e o evento nao funciona nao aparece msg nem nada. Alguém pode me ajudar pois meu servidor sera inaugurado sabado agr e preciso esta tudo pronto. Meu distro é OTX Server Version 2.1.70.

 

 

 

Fui tentar reinstalar os eventos um de cada vez e o snawball do nada apareceu esse erro

Description: 

attempt to index a nil value

stack traceback:

	[C]: in function 'doSendAnimatedText'

	data/globalevents/scripts/SBW.lua:103: in function 

[Error - GlobalEvents::think] Couldn't execute event: AnimatedSBW



[Error - GlobalEvent Interface] 

data/globalevents/scripts/SBW.lua:onThink

Description: 

attempt to index a nil value

stack traceback:

	[C]: in function 'doSendAnimatedText'

	data/globalevents/scripts/SBW.lua:103: in function 

[Error - GlobalEvents::think] Couldn't execute event: AnimatedSBW

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino

Mande o script por favor amigo

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

DavyziinC

Sou Pica néguim
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 07/02/12Posts: 207Char no Tibia: Não lembro :(
 

Mande o script por favor amigo

Opa boa noite desculpa pela demora tava no trabalho aqui esta a scripts

function onTime()
                
function isInWallArray(pos)
    for k = 0, table.getn(SBW_WALLSID) do
        if (getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k]) then
            return true    
        end    
    end
 return false
end

               
function endsnowball()
    local score = {}
    if not SBW_USEWAIT then
        doRemoveItem(getTileItemById(SBW_TP, 1387).uid)
    end
    for _, pid in ipairs(getPlayersOnline()) do
        if getPlayerStorageValue(pid, SBW_INEVENT) > 0 then
            table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
            doPlayerSetStorageValue(pid, SBW_INEVENT, 0)
            doPlayerSetStorageValue(pid, SBW_SCORE, 0)
            doPlayerSetStorageValue(pid, SBW_AMMO, 0)
            doTeleportThing(pid, SBW_TPEND)
        end
    end
    table.sort(score, function(a, b) return a[2] > b[2] end)
    local random_item = SBW_REWARDS[math.random(1, #SBW_REWARDS)]
    local hora = os.date("%X")
    local data = os.date("%x")    
    if table.getn(score) > 0 then
        if SBW_ADDREWARD then
            for _, pid in ipairs(getPlayersOnline()) do
                if getCreatureName(pid) == score[1][1] then
                    doPlayerAddItem(pid, random_item, 1)
                    break
                end
            end
        end
        db.query("INSERT INTO `snowballwar`  VALUES ('', ".. db.escapeString(score[1][1]) ..  ",".. score[1][2] ..", ".. db.escapeString(data) ..", ".. db.escapeString(hora) ..");")  
        db.query("UPDATE `players` SET `sbw_points`=`sbw_points`+".. score[1][2] .." WHERE `name` = " .. db.escapeString(score[1][1]) .. ";")
        doBroadcastMessage("[SNOWBALL WAR] Foi encerrado, parabens ao jogador "..score[1][1].." que venceu o SnowBall com "..score[1][2].." pontos.")
    end
    return true
end

local t_l = SBW_AREA[1]
local b_r = SBW_AREA[2]

function moveToEvent()
for _, pid in ipairs(getPlayersOnline()) do
    if isInRange(getCreaturePosition(pid), SBW_WAITROOM[1], SBW_WAITROOM[2]) then
        local posti = {}
        local isPossibleToTeleportPlayer = false
        while (isPossibleToTeleportPlayer == FALSE) do
            posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
            if (isInWallArray(posti) == FALSE) then
                isPossibleToTeleportPlayer = TRUE
            end
        end
        doTeleportThing(pid, posti)
        doPlayerSetStorageValue(pid, SBW_INEVENT, 1)
        doPlayerSetStorageValue(pid, SBW_AMMO, SBW_MINAMMO)
        doPlayerSetStorageValue(pid, SBW_SCORE, 0)
        doPlayerSendTextMessage(pid, 27, "[SNOWBALL WAR] Seja bem vindo, aqui estao os comandos que voce vai usar durante o evento\n!snowball atirar --Atirar uma bola de neve.\n!snowball info --Isso mostra seus pontos de jogos e a quantia de bolas de neve que voce tem. Tambem mostra o ranking de pontos do evento.\n Recarregue suas bolas de neve clicando em frente ao gerador no centro do campo.\nAltamente recomendado adicionar estes comandos a sua hotkeys.")                                                                       
    end
end
doRemoveItem(getTileItemById(SBW_TP, 1387).uid)
addEvent(endsnowball, SBW_DURATION*1000*60)
doBroadcastMessage(SBW_MSGSTART)
end

local time = os.date("*t")
local timeopen1 = math.ceil(SBW_TIMEWAIT / 4)
local timeopen2 = math.ceil(SBW_TIMEWAIT / 2)
if (SBW_STARTAUTO) and (isInArray(SBW_DAYS,time.wday)) then
    doBroadcastMessage(SBW_MSGWARNING)
    if SBW_USEWAIT then
        addEvent(doBroadcastMessage, timeopen1*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen2 .." minuto(s) para iniciar o evento!")
        if (timeopen2 ~= timeopen1) then
            addEvent(doBroadcastMessage, timeopen2*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen1 .." minuto(s) para iniciar o evento!")
        end
        addEvent(moveToEvent, SBW_TIMEWAIT*1000*60)
        doCreateTeleport(1387, SBW_TPGO, SBW_TP)
    else
        if SBW_TFS == "0.3" then
            doItemSetAttribute(doCreateItem(1387, SBW_TP), "aid", 2880)
        else
            doSetItemActionId(doCreateItem(1387, SBW_TP), 2880)
        end
        if(SBW_DURATION > 0) then
            addEvent(endsnowball, SBW_DURATION*1000*60)
        end
    end
end
return true
end

function onThink(interval, lastExecution)
local texts = {["GERADOR"] = {SBW_GERADOR, 55, TEXTCOLOR_ORANGE}}

for text, param in pairs(texts) do
    doSendAnimatedText(param[1], text, param[3])
    doSendMagicEffect(param[1], param[2])
end
return TRUE
end

DavyziinC

Sou Pica néguim
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 07/02/12Posts: 207Char no Tibia: Não lembro :(

@up

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino

@DavyziinC

function onTime()
                
function isInWallArray(pos)
    for k = 0, table.getn(SBW_WALLSID) do
        if (getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k]) then
            return true    
        end    
    end
 return false
end

               
function endsnowball()
    local score = {}
    if not SBW_USEWAIT then
        doRemoveItem(getTileItemById(SBW_TP, 1387).uid)
    end
    for _, pid in ipairs(getPlayersOnline()) do
        if getPlayerStorageValue(pid, SBW_INEVENT) > 0 then
            table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
            doPlayerSetStorageValue(pid, SBW_INEVENT, 0)
            doPlayerSetStorageValue(pid, SBW_SCORE, 0)
            doPlayerSetStorageValue(pid, SBW_AMMO, 0)
            doTeleportThing(pid, SBW_TPEND)
        end
    end
    table.sort(score, function(a, b) return a[2] > b[2] end)
    local random_item = SBW_REWARDS[math.random(1, #SBW_REWARDS)]
    local hora = os.date("%X")
    local data = os.date("%x")    
    if table.getn(score) > 0 then
        if SBW_ADDREWARD then
            for _, pid in ipairs(getPlayersOnline()) do
                if getCreatureName(pid) == score[1][1] then
                    doPlayerAddItem(pid, random_item, 1)
                    break
                end
            end
        end
        db.query("INSERT INTO `snowballwar`  VALUES ('', ".. db.escapeString(score[1][1]) ..  ",".. score[1][2] ..", ".. db.escapeString(data) ..", ".. db.escapeString(hora) ..");")  
        db.query("UPDATE `players` SET `sbw_points`=`sbw_points`+".. score[1][2] .." WHERE `name` = " .. db.escapeString(score[1][1]) .. ";")
        doBroadcastMessage("[SNOWBALL WAR] Foi encerrado, parabens ao jogador "..score[1][1].." que venceu o SnowBall com "..score[1][2].." pontos.")
    end
    return true
end

local t_l = SBW_AREA[1]
local b_r = SBW_AREA[2]

function moveToEvent()
for _, pid in ipairs(getPlayersOnline()) do
    if isInRange(getCreaturePosition(pid), SBW_WAITROOM[1], SBW_WAITROOM[2]) then
        local posti = {}
        local isPossibleToTeleportPlayer = false
        while (isPossibleToTeleportPlayer == FALSE) do
            posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
            if (isInWallArray(posti) == FALSE) then
                isPossibleToTeleportPlayer = TRUE
            end
        end
        doTeleportThing(pid, posti)
        doPlayerSetStorageValue(pid, SBW_INEVENT, 1)
        doPlayerSetStorageValue(pid, SBW_AMMO, SBW_MINAMMO)
        doPlayerSetStorageValue(pid, SBW_SCORE, 0)
        doPlayerSendTextMessage(pid, 27, "[SNOWBALL WAR] Seja bem vindo, aqui estao os comandos que voce vai usar durante o evento\n!snowball atirar --Atirar uma bola de neve.\n!snowball info --Isso mostra seus pontos de jogos e a quantia de bolas de neve que voce tem. Tambem mostra o ranking de pontos do evento.\n Recarregue suas bolas de neve clicando em frente ao gerador no centro do campo.\nAltamente recomendado adicionar estes comandos a sua hotkeys.")                                                                       
    end
end
doRemoveItem(getTileItemById(SBW_TP, 1387).uid)
addEvent(endsnowball, SBW_DURATION*1000*60)
doBroadcastMessage(SBW_MSGSTART)
end

local time = os.date("*t")
local timeopen1 = math.ceil(SBW_TIMEWAIT / 4)
local timeopen2 = math.ceil(SBW_TIMEWAIT / 2)
if (SBW_STARTAUTO) and (isInArray(SBW_DAYS,time.wday)) then
    doBroadcastMessage(SBW_MSGWARNING)
    if SBW_USEWAIT then
        addEvent(doBroadcastMessage, timeopen1*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen2 .." minuto(s) para iniciar o evento!")
        if (timeopen2 ~= timeopen1) then
            addEvent(doBroadcastMessage, timeopen2*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen1 .." minuto(s) para iniciar o evento!")
        end
        addEvent(moveToEvent, SBW_TIMEWAIT*1000*60)
        doCreateTeleport(1387, SBW_TPGO, SBW_TP)
    else
        if SBW_TFS == "0.3" then
            doItemSetAttribute(doCreateItem(1387, SBW_TP), "aid", 2880)
        else
            doSetItemActionId(doCreateItem(1387, SBW_TP), 2880)
        end
        if(SBW_DURATION > 0) then
            addEvent(endsnowball, SBW_DURATION*1000*60)
        end
    end
end
return true
end

function onThink(interval, lastExecution)
local texts = {["GERADOR"] = {SBW_GERADOR, 55, TEXTCOLOR_ORANGE}}

for text, param in pairs(texts) do
    doSendAnimatedText(param[1], text, param[3],getPlayerPosition(cid),math.random(1,255))
    doSendMagicEffect(param[1], param[2])
end
return TRUE
end

Dar uma testada ae e ver oque dar

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

DavyziinC

Sou Pica néguim
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 07/02/12Posts: 207Char no Tibia: Não lembro :(

já ajeitei esse erro agr ta dando esse erro

 

>>> Loading movements... [Error - LuaInterface::loadFile] cannot open data/movements/scripts/snowballmovement.lua: No such file or directory
[Error - Event::checkScript] Cannot load script (data/movements/scripts/snowballmovement.lua)

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
 

já ajeitei esse erro agr ta dando esse erro

 

>>> Loading movements... [Error - LuaInterface::loadFile] cannot open data/movements/scripts/snowballmovement.lua: No such file or directory
[Error - Event::checkScript] Cannot load script (data/movements/scripts/snowballmovement.lua)

Esse Erro e porque n servidor n consegue encontrar o diretorio da script

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel