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
somebody can help me?
sorry for me bad english x)
THX
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