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

Simple and useful anti-clone system. /i

  • Thread starter Thread starter Rozinx
  • Start date Start date
R

Rozinx

Guest
A /i script that would automatically atributte an uniqueid.
I just don't know how to make it check automatically for the old uniqueid.
Like this :


/i magic plate armor (uid 1)
/i brass legs (uid 2)

Anyone? ;>
 
Try this:
This will add you a storage value for each items that you made.. And action id = 15000 + you storage value
LUA:
function onSay(cid, words, param, channel)
local valiu = getPlayerStorageValue(cid, 58858) + 1
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local t = string.explode(param, ",")
	local ret = RETURNVALUE_NOERROR
	local pos = getCreaturePosition(cid)

	local id = tonumber(t[1])
	if(not id) then
		id = getItemIdByName(t[1], false)
		if(not id) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
			return true
		end
	end

	local amount = 100
	if(t[2]) then
		amount = t[2]
	end

	local item = doCreateItemEx(id, amount)
	local itemAct = doSetItemActionId(item, 15000 + getPlayerStorageValue(cid, 58858))
	if(t[3] and getBooleanFromString(t[3])) then
		if(t[4] and getBooleanFromString(t[4])) then
			pos = getCreatureLookPosition(cid)
		end

		ret = doTileAddItemEx(pos, itemAct)
            setPlayerStorageValue(cid, 58858, 15000 + valiu)
	else
		ret = doPlayerAddItemEx(cid, itemAct, true)
		setPlayerStorageValue(cid, 58858, 15000 + valiu)
	end

	if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return true
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
	end

	return true
end
 
Back
Top