• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Problema] problema al matar a un player

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Problema] problema al matar a un player Empty [Problema] problema al matar a un player Sáb Mayo 21, 2022 8:41 am

    akane

    akane
    Miembro
    Miembro
    Descripcion escribió:hola a todos, tengo un problema al matar a un player haciendo que me aparezca este error:


    Código:
    [4:31:47.515] [Error - CreatureScript Interface]
    [4:31:47.516] domodlib('function_config')
    [4:31:47.518]
    [4:31:47.520] local PZ = createConditionObject(CONDITION_INFIGHT)
    [4:31:47.523] setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))

    [4:31:47.526] function onKill(cid, target, lastHit)

    [4:31:47.527]        if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then

    [4:31:47.531] local config = {
    [4:31:47.532]                removeFrags = true -- If 'true' player won't gain frags from a player that is versus him; else, player will gain frags as normal.
    [4:31:47.538]                }

    [4:31:47.539]        local GUID = getPlayerGUID(cid)
    [4:31:47.541]        local namec = getPlayerName(cid)
    [4:31:47.543]        local namet = getPlayerName(target)
    [4:31:47.545]        local skull = getCreatureSkullType(cid)
    [4:31:47.547]        local skullend = getPlayerSkullEnd(cid)
    [4:31:47.549]    local playerPos = getPlayerPosition(cid)
    [4:31:47.551]    local targetPos = getPlayerPosition(target)
    [4:31:47.553]        local cidd = cid

    [4:31:47.555]        local timeA = os.time()
    [4:31:47.557]        local timesA = {today = (timeA - 86400), week = (timeA - (7 * 86400))}

    [4:31:47.559]        local contentsA, resultA = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` 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` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (timeA - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    [4:31:47.575]        if(resultA:getID() ~= -1) then
    [4:31:47.577]                repeat
    [4:31:47.578]                        local contentA = {
    [4:31:47.580]                                name = resultA:getDataString("name"),
    [4:31:47.583]                                level = resultA:getDataInt("level"),
    [4:31:47.587]                                date = resultA:getDataInt("date")
    [4:31:47.590]                        }
    [4:31:47.591]                        if(contentA.date > timesA.today) then
    [4:31:47.594]                                table.insert(contentsA.day, contentA)
    [4:31:47.597]                        elseif(contentA.date > timesA.week) then
    [4:31:47.600]                                table.insert(contentsA.week, contentA)
    [4:31:47.603]                        else
    [4:31:47.604]                                table.insert(contentsA.month, contentA)
    [4:31:47.607]                        end
    [4:31:47.609]                until not resultA:next()
    [4:31:47.610]                resultA:free()
    [4:31:47.612]        end

    [4:31:47.613]        local sizeA = {
    [4:31:47.614]                day = table.maxn(contentsA.day),
    [4:31:47.616]                week = table.maxn(contentsA.week),
    [4:31:47.619]                month = table.maxn(contentsA.month)
    [4:31:47.621]        }
    [4:31:47.622] local function removeFrag(cid)

    [4:31:47.623]        local timeB = os.time()
    [4:31:47.624]        local timesB = {today = (timeB - 86400), week = (timeB - (7 * 86400))}

    [4:31:47.627]        local contentsB, resultB = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` 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 .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (timeB - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    [4:31:47.640]        if(resultB:getID() ~= -1) then
    [4:31:47.642]                repeat
    [4:31:47.643]                        local contentB = {
    [4:31:47.645]                                name = resultB:getDataString("name"),
    [4:31:47.647]                                level = resultB:getDataInt("level"),
    [4:31:47.651]                                date = resultB:getDataInt("date")
    [4:31:47.653]                        }
    [4:31:47.654]                        if(contentB.date > timesB.today) then
    [4:31:47.657]                                table.insert(contentsB.day, contentB)
    [4:31:47.659]                        elseif(contentB.date > timesB.week) then
    [4:31:47.662]                                table.insert(contentsB.week, contentB)
    [4:31:47.664]                        else
    [4:31:47.666]                                table.insert(contentsB.month, contentB)
    [4:31:47.668]                        end
    [4:31:47.670]                until not resultB:next()
    [4:31:47.671]                resultB:free()
    [4:31:47.673]        end

    [4:31:47.674]        local sizeB = {
    [4:31:47.675]                day = table.maxn(contentsB.day),
    [4:31:47.677]                week = table.maxn(contentsB.week),
    [4:31:47.679]                month = table.maxn(contentsB.month)
    [4:31:47.681]        }


    [4:31:47.682] if sizeB.day > sizeA.day or sizeB.week > sizeA.week or sizeB.month > sizeA.month then
    [4:31:47.686]        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..GUID..") ORDER BY `death_id` DESC LIMIT 1;")
    [4:31:47.691]        doPlayerSendTextMessage(cidd, 21, "Frag from "..namet.." wasn't counted.")
    [4:31:47.694] end

    [4:31:47.695] if skull == SKULL_RED then
    [4:31:47.696]        if getCreatureSkullType(cidd) == SKULL_BLACK then
    [4:31:47.698]                doPlayerSetSkullEnd(cidd, skullend, SKULL_RED)
    [4:31:47.701]                doCreatureSetSkullType(cidd, SKULL_RED)
    [4:31:47.703]        end
    [4:31:47.704] elseif skull == SKULL_WHITE then
    [4:31:47.706]        if getCreatureSkullType(cidd) == SKULL_RED then
    [4:31:47.708]                doPlayerSetSkullEnd(cidd, timeB, SKULL_RED)
    [4:31:47.710]                doCreatureSetSkullType(cidd, SKULL_WHITE)
    [4:31:47.712]        end
    [4:31:47.713] end

    [4:31:47.714] end

    [4:31:47.715]                local myGuild = getPlayerGuildId(cid)
    [4:31:47.717]                local enemyGuild = getPlayerGuildId(target)

    [4:31:47.720]                if myGuild ~= 0 and enemyGuild ~= 0 then
    [4:31:47.722]                        if enemyGuild == getGuildWarInfo(myGuild).With then
    [4:31:47.724] local guildc = getPlayerGuildName(cid)
    [4:31:47.726] local guildt = getPlayerGuildName(target)
    [4:31:47.728]                                doAddCondition(cid, PZ)

    [4:31:47.730]                                if lastHit == TRUE then
    [4:31:47.732]                    if getTileZoneInfo(playerPos) == 0 and getTileZoneInfo(targetPos) == 0 then
    [4:31:47.735]                                            if getShowInfo(myGuild) == 1 then
    [4:31:47.738]                                                    registerDeathOne(myGuild, enemyGuild, cid, target)
    [4:31:47.741]                                            else
    [4:31:47.743]                                                    registerDeathTwo(myGuild, enemyGuild, cid, target)
    [4:31:47.746]                                            end
    [4:31:47.748]                    else
    [4:31:47.749]                        doPlayerSendTextMessage(cid, 19, "Remember: in PvP zone the system doesn't register the frag.")
    [4:31:47.754]                    end
    [4:31:47.755]                                end

    [4:31:47.757]                                if config.removeFrags == true then
    [4:31:47.759]                                        addEvent(removeFrag, 150)
    [4:31:47.761]                                end

    [4:31:47.763] local gsim = getShowInfo(myGuild)
    [4:31:47.765] local gsie = getShowInfo(enemyGuild)

    [4:31:47.767] if gsim > gsie then
    [4:31:47.768]    resulta = getKills(guildc)
    [4:31:47.770]    resultb = getKills(guildt)
    [4:31:47.771] else
    [4:31:47.772]    resulta = getKills(guildt)
    [4:31:47.773]    resultb = getKills(guildc)
    [4:31:47.774] end

    [4:31:47.775] local players = getOnlinePlayers()
    [4:31:47.776]    for i,playerName in ipairs(players) do
    [4:31:47.778]        local player = getPlayerByName(playerName);
    [4:31:47.780]        if getPlayerGuildId(player) == myGuild then
    [4:31:47.782]    if getTileZoneInfo(playerPos) == 0 and getTileZoneInfo(targetPos) == 0 then
    [4:31:47.785]            doPlayerSendChannelMessage(player, "", "Opponent "..namet.." of the "..guildt.." was killed by "..namec..". The new score is "..resulta..":"..resultb.." frags.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
    [4:31:47.792]    end
    [4:31:47.792]        end
    [4:31:47.793]    end
    [4:31:47.794]                        end
    [4:31:47.795]                end
    [4:31:47.796]        end
    [4:31:47.797]        return TRUE
    [4:31:47.798] end:onKill
    [4:31:47.799] Description:
    [4:31:47.800] [string "LuaInterface::loadBuffer"]:104: attempt to index a number value
    [4:31:47.803] stack traceback:
    [4:31:47.804]  [string "LuaInterface::loadBuffer"]:104: in function <[string "LuaInterface::loadBuffer"]:6>
    [4:31:48.372] mysql_real_query(): SELECT `invited_to`, `invited_by`, `in_war_with`,`war_time` FROM `guilds` WHERE `id` = 12 - MYSQL ERROR: Unknown column 'invited_to' in 'field list' (1054)

    al quitarle toda la hp el char se queda parado sin barra de vida y si se le sigue atacando se recupera completamente haciendo que este no muera
    Captura del Error escribió:Imagen del error: [Problema] problema al matar a un player Empty
    El error radica en: Consola

    2 participantes

    2[Problema] problema al matar a un player Empty Re: [Problema] problema al matar a un player Sáb Mayo 21, 2022 11:22 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    dice que en tu base de datos no existe s

    Código:

    Unknown column 'invited_to' in 'field list' (1054)

    la culumna invited en la tabla guild tendras que revisar o buscar aquella tabla corregir ese problema



    [Problema] problema al matar a un player YNU5B25
    2 participantes
    http://www.tibiaface.com

    3[Problema] problema al matar a un player Empty Re: [Problema] problema al matar a un player Miér Mayo 25, 2022 5:29 am

    akane

    akane
    Miembro
    Miembro
    actualizar la tabla guilds, y agregar otra tabla y ahí me funcionó

    2 participantes

    Contenido patrocinado


    2 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).