Help. I have TFS 0.3.6 and this script:http://otland.net/f82/low-level-death-protection-39020/
And i ded, HP dont recover, still on temple with 0 HP and high effects
Screen:
Sorry with my english :/
Script:
In logs i have only this:
And i ded, HP dont recover, still on temple with 0 HP and high effects
Screen:
Sorry with my english :/
Script:
PHP:
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords'),
deadProtection = getConfigInfo('deadProtection')
}
config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if(isPlayer(cid))then
if(math.abs(config.deadProtection) >= getPlayerLevel(cid))then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), TRUE)
doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
doSendMagicEffect(getCreaturePosition(cid), 37)
doRemoveCondition(cid, CONDITION_INFIGHT)
else
if(config.deathListEnabled ~= TRUE) then
return TRUE
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
return TRUE
end
end
end
In logs i have only this:
[Warning - Groups::getGroup] Group 0 not found.
[Warning - Groups::getGroup] Group 0 not found.