Hello.
I have a problem with GanGrel v-5.0 SQL for 8.50.
When players died they do not lose thier backpack, I tried to go Vocation.xml but I couldnt find any option which relates to the reason that they dont lose backpack...
I also tried in config.lua but nothing there....
Anyone know where it could be?.....
Here is my playerdeath.lua
And here is my Login.lua
Thanks!
I have a problem with GanGrel v-5.0 SQL for 8.50.
When players died they do not lose thier backpack, I tried to go Vocation.xml but I couldnt find any option which relates to the reason that they dont lose backpack...
I also tried in config.lua but nothing there....
Anyone know where it could be?.....
Here is my playerdeath.lua
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled == TRUE) then
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:numRows(true) - config.maxDeathRecords)
if(amount > 0) then
if(config.sqlType == "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
end
And here is my Login.lua
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
end
end
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
local loss = getConfigValue('itemLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 10)
end
Thanks!
Last edited: