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

Bug script

setembro

New Member
Joined
May 22, 2008
Messages
110
Reaction score
1
hi i have bug script link http://otland.net/f81/basic-anti-dupe-system-131898/

bug is



[21:41:35.953] [Error - TalkAction Interface]
[21:41:35.953] data/talkactions/scripts/trackitems.luanSay
[21:41:35.953] Description:
[21:41:35.968] (luaGetPlayerNameByGUID) Player not found

[21:41:35.968] [Error - TalkAction Interface]
[21:41:35.968] data/talkactions/scripts/trackitems.luanSay
[21:41:35.968] Description:
[21:41:35.968] data/talkactions/scripts/trackitems.lua:8: attempt to concatenate
a nil value
[21:41:35.968] stack traceback:
[21:41:35.968] data/talkactions/scripts/trackitems.lua:8: in function <data/tal
kactions/scripts/trackitems.lua:1>
 
You need to paste this at your lib/functions.lua:
Lua:
function generateSerial()
	local strings = "ABCDEFGHIJKLMOPQRSTUVWXYZ"
	local newSerialStr, newSerialInt = "", 0
	local newSerial = ""
	local query
	repeat
		for k = 1, math.random(1, 10) do
			local l = math.random(1, string.len(strings))
			newSerialStr = newSerialStr .. string.sub(strings, l, l)
		end
		newSerialInt = math.random(999999)
		newSerial = newSerialStr .. "-" .. newSerialInt
		query = db.getResult("select * from player_items where substring(convert(attributes using latin1) from 18) = " .. db.escapeString(newSerial))
	until query:getID() == -1
	return "!" .. newSerial
end


trackitems.lua
Lua:
function onSay(cid, words, param, channel)
 
	if(param ~= "duplicated") then
		local query = db.getResult("select *, substring(convert(attributes using latin1) from 18) as 'track' from player_items where convert(attributes using latin1) like '%serial%'")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Here is a list of all items with serial.\nOwner Name - ItemID - Count - Serial")
		if query:getID() ~= -1 then
			while(true) do
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerNameByGUID(query:getDataInt("player_id")) .. " - " .. query:getDataInt("itemtype") .. " - " .. query:getDataInt("count") .. " - " .. query:getDataString("track"))
				if not query:next() then break end
			end
		end
	else
		local query = db.getResult("SELECT *, SUBSTRING(CONVERT(attributes USING latin1) FROM 18) AS 'track' FROM player_items WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 18) IN (SELECT SUBSTRING(CONVERT(attributes USING latin1) FROM 18) FROM player_items WHERE CONVERT(attributes USING latin1) LIKE '%serial%' GROUP BY SUBSTRING(CONVERT(attributes USING latin1) FROM 18) HAVING COUNT(*) > 1)")
		if query:getID() ~= -1 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Here is a list of all items with duplicated serial.\nOwner Name - ItemID - Count - Serial")
			while(true) do
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerNameByGUID(query:getDataInt("player_id")) .. " - " .. query:getDataInt("itemtype") .. " - " .. query:getDataInt("count") .. " - " .. query:getDataString("track"))
				if not query:next() then break end
			end
		else
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No items with duplicated serial.")
		end
	end
	return true
end
 
Back
Top