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

Command /i that dont able to create items XYZ

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
Well, I would like one script that able to make items, exept one row of items, but if name of god is Inferno-ot Owner, it allow. Or at least only to dont let make the ids:
Code:
2196, 7461, 2505, 3975, 2507, 3982, 5958, 7423, 7416, 7435, 7427, 7958, 7426, 9975, 5785, 8932, 9927, 8879, 9928, 7892, 2537, 2300, 2316, 2297, 2128, 6880, 9777, 7893, 6391, 2275, 2312, 2363, 8306, 2424, 7420, 2408, 7437, 8854, 2299, 9003

Idk if us understand but i want this:
God XYZ try /i Donated Helmet. (one of the ids up) and it say "You cannot create donated items".
Inferno-ot Owner try /i Donated Helmet. And it works.
Or at least to block donated items :P

my /i script
Code:
function onSay(cid, words, param, channel)
	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 tmp = 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)
	if(t[3] and getBooleanFromString(t[3])) then
		if(t[4] and getBooleanFromString(t[4])) then
			tmp = getPlayerLookPos(cid)
		end

		ret = doTileAddItemEx(tmp, item)
	else
		ret = doPlayerAddItemEx(cid, item, true)
	end

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

	doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
	return true
end

tyy
 
Code:
[B][COLOR="Red"]local _t = {
	restricted = {2196, 7461, 2505, 3975, 2507, 3982, 5958, 7423, 7416, 7435, 7427, 7958, 7426, 9975, 5785, 8932, 9927, 8879, 9928, 7892, 2537, 2300, 2316, 2297, 2128, 6880, 9777, 7893, 6391, 2275, 2312, 2363, 8306, 2424, 7420, 2408, 7437, 8854, 2299, 9003},
	allowedNames = {'Inferno-ot Owner'}
}[/COLOR][/B]

function onSay(cid, words, param, channel)
	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 tmp = 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 with such name does not exist.")
			return true
		end
	end

[B][COLOR="Red"]	if isInArray(_t.restricted, id) and not isInArray(_t.allowedNames, getCreatureName(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot create donated items.")
		return true
	end[/COLOR][/B]

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

	local item = doCreateItemEx(id, amount)
	if(t[3] and getBooleanFromString(t[3])) then
		if(t[4] and getBooleanFromString(t[4])) then
			tmp = getPlayerLookPos(cid)
		end

		ret = doTileAddItemEx(tmp, item)
	else
		ret = doPlayerAddItemEx(cid, item, true)
	end

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

	doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
	return true
end
 
Last edited:
Back
Top