Fire Element
Member
Error:
Script:
Code:
[17/11/2011 18:53:23] GOD has logged in.
[17/11/2011 18:53:26] GOD has logged out.
[17/11/2011 18:53:26] sqlite3_step(): SQLITE ERROR: cannot commit transaction - SQL statements in progress
[17/11/2011 18:53:26] sqlite3_step(): SQLITE ERROR: cannot start a transaction within a transaction
[17/11/2011 18:53:26] sqlite3_step(): SQLITE ERROR: cannot rollback transaction - SQL statements in progress
[17/11/2011 18:53:26] sqlite3_step(): SQLITE ERROR: cannot start a transaction within a transaction
[17/11/2011 18:53:26] sqlite3_step(): SQLITE ERROR: cannot rollback transaction - SQL statements in progress
[17/11/2011 18:53:26] Error while saving player: GOD.
[17/11/2011 18:53:26] [Error - TalkAction Interface]
[17/11/2011 18:53:26] data/talkactions/scripts/resetSystem.lua:onSay
[17/11/2011 18:53:26] Description:
[17/11/2011 18:53:26] (internalGetPlayerInfo) Player not found when requesting player info #3
[17/11/2011 18:53:26] [Error - TalkAction Interface]
[17/11/2011 18:53:26] data/talkactions/scripts/resetSystem.lua:onSay
[17/11/2011 18:53:26] Description:
[17/11/2011 18:53:26] data/talkactions/scripts/resetSystem.lua:67: attempt to compare number with boolean
[17/11/2011 18:53:26] stack traceback:
[17/11/2011 18:53:26] data/talkactions/scripts/resetSystem.lua:67: in function <data/talkactions/scripts/resetSystem.lua:28>
[17/11/2011 18:53:27] GOD has logged in.
Script:
Lua:
config = {
protectZone = true,
redSkull = true,
battleMode = true,
backLevel = 8,
exp = 4200
}
stage = {
{reset = 4, level = 350},
{reset = 9, level = 355},
{reset = 14, level = 360},
{reset = 19, level = 365},
{reset = 24, level = 380},
{reset = 29, level = 390},
{reset = 34, level = 410},
{reset = 39, level = 430},
{reset = 44, level = 450},
{reset = 49, level = 480},
{reset = 54, level = 510},
{reset = 59, level = 550},
{reset = 64, level = 590},
{reset = 69, level = 630},
{reset = 74, level = 680},
{reset = 79, level = 730},
{reset = 84, level = 780}
}
function onSay(cid, words, param, channel)
local pid = getPlayerGUID(cid)
-- Functions
function doPlayerAddReset(cid, amount)
db.executeQuery("UPDATE `players` SET `resets` = `resets` + "..amount.." WHERE `id` = "..pid)
end
function getPlayerReset(cid)
k = db.getResult("SELECT `resets` FROM `players` WHERE `id`= "..pid..";"):getDataInt("resets", pid)
if k < 0 then
k = 0
end
return k
end
function doPlayerReset(cid, level, exp, amount)
doPlayerAddReset(cid, amount)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..level..", `experience` = "..exp.." WHERE `id` = "..pid)
end
-- Functions
if(config.redSkull == true) and (getCreatureSkullType(cid) == 4) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Red skull can't reset.")
end
if(config.protectZone == true) and (getTilePzInfo(getCreaturePosition(cid)) == false) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be in protect zone to reset.")
end
if(config.battleMode == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be without battle to reset.")
end
if(words == "!checkreset") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have "..getPlayerReset(cid).." resets.")
end
for k, v in ipairs(stage) do
if getPlayerReset(cid) <= v.reset then
if getPlayerLevel(cid) >= v.level then
doPlayerReset(cid, config.backLevel, config.exp, 1)
else
return doPlayerSendCancel(cid, "You don't have the required level. (Level: "..v.level..")")
end
end
end
return true
end