• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Anyone may help me to fix this

TSFMAG

Enjoy being different.
Joined
Jun 11, 2017
Messages
9
Reaction score
1
I'd like to fix this:
Lua:
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/report.lua:20: '}' expected (to close '{' at line 15) near 'function'
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/report.lua)
data/talkactions/scripts/report.lua:20: '}' expected (to close '{' at line 15) near 'function'

Here my report.lua:
Lua:
function onSay(cid, words, param, channel) local time = 4 ---- Exhaustion cada numeral equivale a 1 hora. if param == "" or not param or param == " " then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "E necessario escrever o report") and false end if exhaustion.get(cid, 23246) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você atingiu o limite de reports espere o limite sair") and false end if #param <= 4 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O seu report deve conter mais de 4 caracteres") and false end exhaustion.set(cid, 23246, time*36000*1000) doPlayerAddReport(cid, param) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns seu report foi enviado para nosso banco de dados logo ele sera visto\nA equipe agradece") return true end

Or if you have a script /report better post it here please, thanks for your time!
 
Last edited:
Lua:
function getReportByGuid(guid)
    local shop = db.getResult("SELECT * FROM `report` WHERE `id` = ".. guid ..";")
    return shop:getDataString("report")
end
function doPlayerAddReport(cid, report)
    db.executeQuery("INSERT INTO `report` (`id`, `report`, `level`) VALUES (" .. getPlayerGUID(cid) .. ", " .. report .. ", " .. getPlayerLevel(cid) .. ");")
    return true
end

function showReports(cid)
    local rep = db.getResult("SELECT * FROM `report` WHERE `id` ORDER BY `level`")
    str = "Reports Ativos:\n\n"
    if rep:getID() == -1 then
        doShowTextDialog(cid, 1387, "Nao ha reports disponiveis!")
        return true
    end
    while true do
        local list = rep:getDataString("report")
        local players = rep:getDataInt("id")
        local name = getPlayerNameByGUID(players)
        str = str .. list .. " -("..players..")- Name ("..name..")]\n\n"
        db.executeQuery("DELETE FROM `report` WHERE `id` = ".. players.." and `report` = '".. list .."';")
        if not rep:next() then
            doShowTextDialog(cid, 1397, str)
            break
        end
    end
end
 
Well nvm, already fixed. Thanks!

Thank you @flaviiojr

Btw i found another bug here:
Code:
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: report (SELECT * FROM "report" WHERE "id" ORDER BY "level")
 
Last edited:
Back
Top