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

Action Cleaning Broom.

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,941
Solutions
11
Reaction score
352
data/actions/actions.xml:
Code:
<action itemid="2324" script="tools/broom.lua"/>

data/actions/scripts/tools/broom.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isMoveable(itemEx.uid) == TRUE then
		doRemoveItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	else
		doPlayerSendCancel(cid, "You can not remove "..getItemNameById(itemEx.itemid)..".")
	end
	return TRUE
end

This is for 0.3 version, if you want to use it on 0.2, replace getItemNameById with getItemName.

Known Bugs:
- You can remove items from you own backpack.
- When you click on player/creature it says "You can not remove water."
 
Just rename the function (remove "byId")
 
Bah, I didn't think of the isMoveable(itemEx.uid) function! Damn you Marcinek! :'(
 
I cant say that this is a great idea because this removes Quest Chestes...and more;)

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.uid ~= 0 or itemEx.actionid ~= 0 then
		return FALSE
	end
	
	if isMoveable(itemEx.uid) == TRUE then
		doRemoveItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	else
		doPlayerSendCancel(cid, "You can not remove "..getItemNameById(itemEx.itemid)..".")
	end
	return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.uid ~= 0 or itemEx.actionid ~= 0 then
		return FALSE
	end
	
	if isMoveable(itemEx.uid) == TRUE then
		doRemoveItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	else
		doPlayerSendCancel(cid, "You can not remove "..getItemNameById(itemEx.itemid)..".")
	end
	return TRUE
end

That's better ;)
 
lol, zonet you dont know how to say good work or thanks ? :/

#Topic
Good work Marc~ :D
 
itemEx is the item on which you have used item.
So replacing itemEx.uid with item.uid would make it to remove your broom instead of the selected item :confused:.
 
Back
Top