president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
i have one error with my script (by shawak
)
error:
[Error - LuaInterface::loadFile] data/talkactions/scripts/sendReport.lua:23: unexpected symbol near 'and'
[Warning - Event::loadScript] Cannot load script <data/talkactions/scripts/sendReport.lua>
data/talkactions/scripts/sendReport.lua:23: unexpected symbol near 'and'
error:
[Error - LuaInterface::loadFile] data/talkactions/scripts/sendReport.lua:23: unexpected symbol near 'and'
[Warning - Event::loadScript] Cannot load script <data/talkactions/scripts/sendReport.lua>
data/talkactions/scripts/sendReport.lua:23: unexpected symbol near 'and'
LUA:
function onSay(cid, words, param, channel)
if getPlayerStorageValue(cid, getConfigValue("reportStorage")) == -1 or os.time() >= (getPlayerStorageValue(cid, getConfigValue("reportStorage")) + getConfigValue("reportExhausted")) then
local pos = getCreaturePosition(cid)
doPlayerSendTextMessage(cid, 18, "Report have been send.")
setPlayerStorageValue(cid, getConfigValue("reportStorage"), os.time())
return db.executeQuery("INSERT INTO `server_reports` ( `id` , `world_id` , `player_id` , `posx` , `posy` , `posz` , `timestamp` , `report` ) VALUES (NULL , "..getConfigValue("worldId")..", "..getPlayerGUID(cid)..", "..pos.x..", "..pos.y..", "..pos.z..", "..os.time()..", '"..param.."');") and TRUE
else
local dif = os.time() - getPlayerStorageValue(cid, getConfigValue("reportStorage"))
local left = getConfigValue("reportExhausted") - dif
local h, m, s = 0, 0, 0
while left >= 3600 do
left = left - 3600
h = h + 1
end
while left >= 60 do
left = left - 60
m = m + 1
end
while left >= 1 do
left = left - 1
s = s+1
end
doPlayerSendTextMessage(cid, 18, "You have to wait "..h.." hourers, "..m.." minutes and "..s.." seconds before reporting again.") and FALSE
end
return TRUE
end