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

[Error] SendReport

Status
Not open for further replies.

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 :D)

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
 
try this
LUA:
function onSay(cid, words, param, channel)
	if getPlayerStorageValue(cid, getConfigValue("reportStorage")) ~= -1 or os.time() < (getPlayerStorageValue(cid, getConfigValue("reportStorage")) + getConfigValue("reportExhausted")) then
                   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.")
        return false
       end
          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.."');") 

        return true
end
 
Status
Not open for further replies.
Back
Top