kleitonalan
New Member
- Joined
- Mar 21, 2013
- Messages
- 289
- Reaction score
- 3
[Error - CreatureScript Interface]
data/creaturescripts/scripts/ban/finish.luanTextEdit
Description:
data/creaturescripts/scripts/ban/finish.lua:69: attempt to call global 'getAccountWarnings' (a nil value)
stack traceback: data/creaturescripts/scripts/ban/finish.lua:69: in function <data/creaturescripts/scripts/ban/finish.lua:10>
data/creaturescripts/scripts/ban/finish.luanTextEdit
Description:
data/creaturescripts/scripts/ban/finish.lua:69: attempt to call global 'getAccountWarnings' (a nil value)
stack traceback: data/creaturescripts/scripts/ban/finish.lua:69: in function <data/creaturescripts/scripts/ban/finish.lua:10>
local warnings, warning = getAccountWarnings(account), 1
if(data.subType == 1) then
if(not tonumber(data.length)) then
data.length = os.time() + config.banLength
if((warnings + 1) >= config.warningsToDeletion) then
data.length = -1
elseif((warnings + 1) >= config.warningsToFinalBan) then
data.length = os.time() + config.finalBanLength
end
else
data.length = os.time() + data.length
end
doAddAccountBanishment(account, player, data.length, data.comment, getPlayerGUID(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerNameByGUID(player) .. " (warnings: " .. (warnings + 1) .. ") has been banned.")
elseif(data.subType == 2) then
doAddAccountBanishment(account, player, config.finalBanLength, data.comment, getPlayerGUID(cid))
if(warnings < config.warningsToFinalBan) then
warning = config.warningsToFinalBan - warnings
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerNameByGUID(player) .. " (warnings: " .. warning .. ") has been banned.")
elseif(data.subType == 3) then
doAddAccountBanishment(account, player, -1, data.comment, getPlayerGUID(cid))
if(warnings < config.warningsToDeletion) then
warning = config.warningsToDeletion - warnings
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerNameByGUID(player) .. " (warnings: " .. warning .. ") has been deleted.")
elseif(data.subType == 4) then
local notations = getNotationsCount(account) + 1
if(notations >= config.notationsToBan) then
data.length = os.time() + config.banLength
if((warnings + 1) >= config.warningsToDeletion) then
data.length = -1
elseif((warnings + 1) >= config.warningsToFinalBan) then
data.length = os.time() + config.finalBanLength
end
doAddAccountBanishment(account, player, data.length, data.comment, getPlayerGUID(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerNameByGUID(player) .. " (warnings: " .. (warnings + 1) .. ") has been banned reaching notations limit.")
else
doAddNotation(account, player, data.comment, getPlayerGUID(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getPlayerNameByGUID(player) .. " (account notations: " .. notations .. ") has been noted.")
warning = 0
end
end
if(warning > 0) then
doAddAccountWarnings(account, warning)
doRemoveNotations(account)
local pid = getPlayerByGUID(player)
if(pid) then
doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, "You have been banned.")
doSendMagicEffect(getThingPosition(pid), CONST_ME_MAGIC_GREEN)
addEvent(valid(doRemoveCreature), 1000, pid, true)
end
end
elseif(data.type == 2) then
errors(false)