• 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!

!report problem TFS 0.3.5 (XvX Server 8.5)

Xapuur

New Member
Joined
Sep 15, 2009
Messages
157
Reaction score
0
Location
Chile
okey.. whis is the script the error is in red, i tested it in TFS 0.3.5 (XvX Server 8.5)
ALL work if i erase the red word's (but the report will not sended, of course), but if don't erase, too all work, but when i report (i use >>>!report "BLA BLA BLA<<<) nothing happens :S

Code:
        local level = 50                         -- Minimum level to send a report.
        local minimum = 5                       -- Minimum characters per report.
        local maximum = 85                      -- Maximum characters per report.

        local useExhaust = true         -- True if you want to use exhaustion, false if not.
        local storageValue = 8000       -- Needed for exhaustion to work. Set to any unused value you wish.
        local exhaustTime = 60          -- Exhaust time between each report (15 = 15 seconds).
       
        local getVoc = getPlayerVocationName(cid)
        local position = getCreaturePosition(cid)

function onSay(cid, words, param, channel)

        if getPlayerLevel(cid) < level then
                        doPlayerSendTextMessage(cid,20,"Report Manager:")
                        doPlayerSendTextMessage(cid,18,"Necesitas ser level "..level.." para reportar.")

                elseif (useExhaust and isExhausted(cid, storageValue, exhaustTime) == TRUE) then
                        doPlayerSendTextMessage(cid,20,"Report Manager:")
                        doPlayerSendTextMessage(cid,18,"Lo siento, necesitas esperar "..exhaustTime.." segundos antes de mandar otro reporte.")

                elseif param:len() < minimum then
                        doPlayerSendTextMessage(cid,20,"Report Manager:")
                        doPlayerSendTextMessage(cid,18,"Lo siento, debes escribir " .. minimum .. " letras minimo para el reporte.")

                elseif param:len() > maximum then
                        doPlayerSendTextMessage(cid,20,"Report Manager:")
                        doPlayerSendTextMessage(cid,18,"Lo siento, solo puedes escribir " .. maximum .. " letras por reporte.")

                else

[COLOR="Red"]                                                Log = io.open(getDataDir().."logs/Reports.txt", "a+")
                        Log:write("Sent: "..os.date("%A %I:%M:%S %p.").."\n")
                        Log:write("From position: X = "..position.x.." | Y = "..position.y.." | Z = "..position.z.."\n")
                        Log:write(""..getPlayerName(cid).." ["..getPlayerLevel(cid).."] ("..getVoc.."): "..param.."\n\n")
                        Log:close()
[/COLOR]

                                doPlayerSendTextMessage(cid,20,"Report Manager:")
                                doPlayerSendTextMessage(cid,27,"Reporte enviado. Gracias por tu ayuda.")
                                setExhaust(cid, storageValue)
                end
                return TRUE
end

somebody can help me?
sorry for me bad english x)
THX
 
Hello ive really have a problem with the
house talkactions:S
cuz when i do !sellhouse it doesent work:/
any1 can give some help here it will be really helpfull im
using TFS 0.3.5 8.50
 
Xapur Try this one

local config = {
expireReportsAfterReads = getConfigValue('expireReportsAfterReads')
}

function onSay(cid, words, param, channel)
if(isNumber(param)) then
local reportId = tonumber(param)
local report = db.getResult("SELECT * FROM `server_reports` WHERE `id` = " .. reportId)
if(report:getID() ~= -1) then
db.executeQuery("UPDATE `server_reports` SET `reads` = `reads` + 1 WHERE `id` = " .. reportId)
doPlayerPopupFYI(cid, "Report no. " .. reportId .. "\n\nName: " .. getPlayerNameByGUID(report:getDataInt("player_id"), true, false) .. "\nPosition: [X: " .. report:getDataInt("posx") .. " | Y: " .. report:getDataInt("posy") .. " | Z: " .. report:getDataInt("posz") .. "]\nDate: " .. os.date("%c", report:getDataInt("timestamp")) .. "\nReport:\n" .. report:getDataString("report"))
report:free()
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Report with no. " .. reportId .. " does not exists.")
end
else
local list = db.getResult("SELECT `id`, `player_id` FROM `server_reports` WHERE `reads` < " .. config.expireReportsAfterReads)
if(list:getID() ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "New reports:")
repeat
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, list:getDataInt("id") .. ", by " .. getPlayerNameByGUID(list:getDataInt("player_id"), true, false) .. ".")
until not list:next()
list:free()
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no active reports.")
end
end

return true
end
 
i tested, and have a error, when i use !report "bla bla bla, always respons: There are no active reports. (tested with player)
 
Back
Top