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

Whats wrong with this !frags?

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
-- /terror text
local messageAmount = 40

Code:
function onSay(cid, words, param)
	if isPlayerGhost(cid) == TRUE then
		enableSleep(function()
			local tmpPos = {}
			local i = 0
			for j = 1, messageAmount * 5 do -- instead of while (for safety)
				local center = getCreaturePosition(cid)
				local pos = Position(math.random(center.x - 7, center.x + 7), math.random(center.y - 5, center.y + 5), center.z, 1)
				local thing = getTileThingByPos(pos)
				if thing.uid > 0 then
					if isCreature(thing.uid) == TRUE or hasProperty(thing.uid, CONST_PROP_BLOCKINGANDNOTMOVEABLE) == FALSE and not comparePos(tmpPos, pos) then
						i = i + 1
						tmpPos = pos
						sleep(math.random(300, 700))
						doCreatureSay(cid, param, TALKTYPE_SAY, pos)
					end
				end
				
				if i == messageAmount then
					break
				end
			end
		end)
	else
		doPlayerSendCancel(cid, "This command is only available while in ghost mode.")
	end
	return TRUE
end


error in console:

Code:
[18/03/2010 20:42:59] [Error - TalkAction Interface] 
[18/03/2010 20:42:59] data/talkactions/scripts/frags.lua
[18/03/2010 20:42:59] Description: 
[18/03/2010 20:42:59] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)
[18/03/2010 20:42:59] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)
[18/03/2010 20:42:59] data/talkactions/scripts/terror.lua:25: unexpected symbol near ')'
 
heres an up to date fixed frags talkaction.

LUA:
local config = {

	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

	advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

}



function onSay(cid, words, param, channel)

	if(not config.useFragHandler) then

		return false

	end



	local time = os.time()

	local times = {today = (time - 86400), week = (time - (7 * 86400))}



	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `k`.`war` = 0 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

	if(result:getID() ~= -1) then

		repeat

			local content = {

				name = result:getDataString("name"),

				level = result:getDataInt("level"),

				date = result:getDataInt("date")

			}

			if(content.date > times.today) then

				table.insert(contents.day, content)

			elseif(content.date > times.week) then

				table.insert(contents.week, content)

			else

				table.insert(contents.month, content)

			end

		until not result:next()

		result:free()

	end



	local size = {

		day = table.maxn(contents.day),

		week = table.maxn(contents.week),

		month = table.maxn(contents.month)

	}

	if(config.advancedFragList) then

		local result = "Frags gained today: " .. size.day .. "."

		if(size.day > 0) then

			for _, content in ipairs(contents.day) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."

		if(size.week > 0) then

			for _, content in ipairs(contents.week) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."

		if(size.month > 0) then

			for _, content in ipairs(contents.month) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

		end



		doPlayerPopupFYI(cid, result)

	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

		if(size.day > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

		end

	end



	return true

end
 
Stil error
Code:
[18/03/2010 20:53:38] [Error - TalkAction Interface] 
[18/03/2010 20:53:38] data/talkactions/scripts/frags.lua
[18/03/2010 20:53:38] Description: 
[18/03/2010 20:53:38] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)
[18/03/2010 20:53:38] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)

also...
Code:
[18/03/2010 20:53:38] [Error - TalkAction Interface] 
[18/03/2010 20:53:38] data/talkactions/scripts/online.lua
[18/03/2010 20:53:38] Description: 
[18/03/2010 20:53:38] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)
[18/03/2010 20:53:38] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/online.lua)


[18/03/2010 20:53:38] [Error - TalkAction Interface] 
[18/03/2010 20:53:38] data/talkactions/scripts/serverinfo.lua
[18/03/2010 20:53:38] Description: 
[18/03/2010 20:53:38] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)
[18/03/2010 20:53:38] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/serverinfo.lua)


I use this server:
Code:
[18/03/2010 20:51:26] The Forgotten Server, version 0.3.6 (Crying Damson)
[18/03/2010 20:51:26] Compiled with GNU C++ version 3.4.5 (mingw special) at Dec 24 2009, 10:39:30.
[18/03/2010 20:51:26] A server developed by Elf, slawkens, Talaturen, KaczooH, Lithium, Kiper, Kornholijo.
[18/03/2010 20:51:26] Visit our forum for updates, support and resources: http://otland.net.
 
What exp of ur server? i tryed go site and
Code:
Warning: parse_ini_file(/home/jonathan/Slain/thenewslain/config.lua) [function.parse-ini-file]: failed to open stream: Permission denied in /var/www/config-and-functions.php on line 13
Database error. Unknown database type in /home/jonathan/Slain/thenewslain/config.lua . Must be equal to: "mysql" or "sqlite". Now is: ""


Exp? Can ya give me basic itens there? ^^
 
Im going home... when i get there, ill try your ot.
THe ot i loved, got a bug in !frags.
It didnt work and i got ban (i got 14 ban is 15... i kiled one and boom ban)
they didnt unban me... and baned my others chars.
Im finding a gooooood ot to play and ... maybe donate (if have donor sistem)
 
Back
Top