When i kill player he no dead;/ he stay with 0 hp and error in consol :
Code:
[16:20:39.202] [Error - CreatureScript Interface]
[16:20:39.202] domodlib('function_config')
[16:20:39.202]
[16:20:39.202] local PZ = createConditionObject(CONDITION_INFIGHT)
[16:20:39.202] setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))
[16:20:39.202] function onKill(cid, target, lastHit)
[16:20:39.202] if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
[16:20:39.202] local config = {
[16:20:39.202] removeFrags = true -- If 'true' player won't gain frags from a player that is versus him; else, player will gain frags as normal.
[16:20:39.202] }
[16:20:39.202] local GUID = getPlayerGUID(cid)
[16:20:39.202] local namec = getPlayerName(cid)
[16:20:39.202] local namet = getPlayerName(target)
[16:20:39.202] local skull = getCreatureSkullType(cid)
[16:20:39.202] local skullend = getPlayerSkullEnd(cid)
[16:20:39.202] local playerPos = getPlayerPosition(cid)
[16:20:39.202] local targetPos = getPlayerPosition(target)
[16:20:39.202] local cidd = cid
[16:20:39.202] local timeA = os.time()
[16:20:39.202] local timesA = {today = (timeA - 86400), week = (timeA - (7 * 86400))}
[16:20:39.202] 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")
[16:20:39.202] if(resultA:getID() ~= -1) then
[16:20:39.202] repeat
[16:20:39.202] local contentA = {
[16:20:39.202] name = resultA:getDataString("name"),
[16:20:39.202] level = resultA:getDataInt("level"),
[16:20:39.202] date = resultA:getDataInt("date")
[16:20:39.202] }
[16:20:39.202] if(contentA.date > timesA.today) then
[16:20:39.202] table.insert(contentsA.day, contentA)
[16:20:39.202] elseif(contentA.date > timesA.week) then
[16:20:39.202] table.insert(contentsA.week, contentA)
[16:20:39.202] else
[16:20:39.202] table.insert(contentsA.month, contentA)
[16:20:39.202] end
[16:20:39.202] until not resultA:next()
[16:20:39.202] resultA:free()
[16:20:39.202] end
[16:20:39.202] local sizeA = {
[16:20:39.202] day = table.maxn(contentsA.day),
[16:20:39.202] week = table.maxn(contentsA.week),
[16:20:39.202] month = table.maxn(contentsA.month)
[16:20:39.202] }
[16:20:39.202] local function removeFrag(cid)
[16:20:39.202] local timeB = os.time()
[16:20:39.202] local timesB = {today = (timeB - 86400), week = (timeB - (7 * 86400))}
[16:20:39.202] 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")
[16:20:39.202] if(resultB:getID() ~= -1) then
[16:20:39.202] repeat
[16:20:39.202] local contentB = {
[16:20:39.202] name = resultB:getDataString("name"),
[16:20:39.202] level = resultB:getDataInt("level"),
[16:20:39.202] date = resultB:getDataInt("date")
[16:20:39.202] }
[16:20:39.202] if(contentB.date > timesB.today) then
[16:20:39.202] table.insert(contentsB.day, contentB)
[16:20:39.202] elseif(contentB.date > timesB.week) then
[16:20:39.202] table.insert(contentsB.week, contentB)
[16:20:39.202] else
[16:20:39.202] table.insert(contentsB.month, contentB)
[16:20:39.203] end
[16:20:39.203] until not resultB:next()
[16:20:39.203] resultB:free()
[16:20:39.203] end
[16:20:39.203] local sizeB = {
[16:20:39.203] day = table.maxn(contentsB.day),
[16:20:39.203] week = table.maxn(contentsB.week),
[16:20:39.203] month = table.maxn(contentsB.month)
[16:20:39.203] }
[16:20:39.203] if sizeB.day > sizeA.day or sizeB.week > sizeA.week or sizeB.month > sizeA.month then
[16:20:39.203] 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;")
[16:20:39.203] doPlayerSendTextMessage(cidd, 21, "Frag from "..namet.." wasn't counted.")
[16:20:39.203] end
[16:20:39.203] if skull == SKULL_RED then
[16:20:39.203] if getCreatureSkullType(cidd) == SKULL_BLACK then
[16:20:39.203] doPlayerSetSkullEnd(cidd, skullend, SKULL_RED)
[16:20:39.203] doCreatureSetSkullType(cidd, SKULL_RED)
[16:20:39.203] end
[16:20:39.203] elseif skull == SKULL_WHITE then
[16:20:39.203] if getCreatureSkullType(cidd) == SKULL_RED then
[16:20:39.203] doPlayerSetSkullEnd(cidd, timeB, SKULL_RED)
[16:20:39.203] doCreatureSetSkullType(cidd, SKULL_WHITE)
[16:20:39.203] end
[16:20:39.203] end
[16:20:39.203] end
[16:20:39.203] local myGuild = getPlayerGuildId(cid)
[16:20:39.203] local enemyGuild = getPlayerGuildId(target)
[16:20:39.203] if myGuild ~= 0 and enemyGuild ~= 0 then
[16:20:39.207] if enemyGuild == getGuildWarInfo(myGuild).With then
[16:20:39.207] local guildc = getPlayerGuildName(cid)
[16:20:39.207] local guildt = getPlayerGuildName(target)
[16:20:39.207] doAddCondition(cid, PZ)
[16:20:39.207] if lastHit == TRUE then
[16:20:39.207] if getTileZoneInfo(playerPos) == 0 and getTileZoneInfo(targetPos) == 0 then
[16:20:39.207] if getShowInfo(myGuild) == 1 then
[16:20:39.207] registerDeathOne(myGuild, enemyGuild, cid, target)
[16:20:39.208] else
[16:20:39.208] registerDeathTwo(myGuild, enemyGuild, cid, target)
[16:20:39.208] end
[16:20:39.208] else
[16:20:39.208] doPlayerSendTextMessage(cid, 19, "Remember: in PvP zone the system doesn't register the frag.")
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] if config.removeFrags == true then
[16:20:39.208] addEvent(removeFrag, 150)
[16:20:39.208] end
[16:20:39.208] local gsim = getShowInfo(myGuild)
[16:20:39.208] local gsie = getShowInfo(enemyGuild)
[16:20:39.208] if gsim > gsie then
[16:20:39.208] resulta = getKills(guildc)
[16:20:39.208] resultb = getKills(guildt)
[16:20:39.208] else
[16:20:39.208] resulta = getKills(guildt)
[16:20:39.208] resultb = getKills(guildc)
[16:20:39.208] end
[16:20:39.208] local players = getOnlinePlayers()
[16:20:39.208] for i,playerName in ipairs(players) do
[16:20:39.208] local player = getPlayerByName(playerName);
[16:20:39.208] if getPlayerGuildId(player) == myGuild then
[16:20:39.208] if getTileZoneInfo(playerPos) == 0 and getTileZoneInfo(targetPos) == 0 then
[16:20:39.208] doPlayerSendChannelMessage(player, "", "Opponent "..namet.." of the "..guildt.." was killed by "..namec..". The new score is "..resulta..":"..resultb.." frags.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] end
[16:20:39.208] return TRUE
[16:20:39.208] end:onKill
[16:20:39.208] Description:
[16:20:39.208] [string "LuaInterface::loadBuffer"]:104: attempt to index a number value
[16:20:39.208] stack traceback:
[16:20:39.208] [string "LuaInterface::loadBuffer"]:104: in function <[string "LuaInterface::loadBuffer"]:6>