wikutag
SoulBound 8.6 100% custom
When someone dies this happens and a body doesnt show on ground
this is the lua
someone help??
Code:
[09/02/2014 05:45:22] mysql_real_query(): UPDATE `players` SET `deaths` = `deaths` + 1 WHERE id = 21; - MYSQL ERROR: Unknown column 'deaths' in 'field list' (1054)
[09/02/2014 05:45:22] mysql_real_query(): UPDATE `players` SET `frags` = `frags` + 1 WHERE id = 4; - MYSQL ERROR: Unknown column 'frags' in 'field list' (1054)
[09/02/2014 05:45:22] mysql_real_query(): SELECT * FROM `bounty_hunters` WHERE `sp_id` = 21 AND `killed` = 0; - MYSQL ERROR: Table 'soullessrl.bounty_hunters' doesn't exist (1146)
[09/02/2014 05:45:22] [Error - CreatureScript Interface]
[09/02/2014 05:45:22] data/creaturescripts/scripts/playerdeath.lua:onDeath
[09/02/2014 05:45:22] Description:
[09/02/2014 05:45:22] (luaGetCreatureName) Creature not found
[09/02/2014 05:45:22] [Error - CreatureScript Interface]
[09/02/2014 05:45:22] data/creaturescripts/scripts/playerdeath.lua:onDeath
[09/02/2014 05:45:22] Description:
[09/02/2014 05:45:22] (luaGetCreatureName) Creature not found
[09/02/2014 05:45:22] [Error - CreatureScript Interface]
[09/02/2014 05:45:22] data/creaturescripts/scripts/playerdeath.lua:onDeath
[09/02/2014 05:45:22] Description:
[09/02/2014 05:45:22] (luaGetCreatureName) Creature not found
[09/02/2014 05:45:22] mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (21, 1391942722, 131, '', ''); - MYSQL ERROR: Unknown column 'time' in 'field list' (1054)
[09/02/2014 05:45:22] mysql_real_query(): DELETE FROM `player_deaths` WHERE `player_id` = 21 ORDER BY `time` LIMIT 11; - MYSQL ERROR: Unknown column 'time' in 'order clause' (1054)
Code:
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}
config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end
local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end
if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end
db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
someone help??