zxmatzx
Advanced OT User
Hello,
I want a event function: onAddItem() that will be called when functions:
I have some ideas how to do, but all forms involve C++, that i don't know.
What i realy need is: When i add a item to player or container, check if item.itemid is in table, and give a actionId to the item.
I know, i can do:
But this way, i always will have to set it manualy in each script that add the itens that is in the table.
The itens in table, will be unique itens, that can't be droped, moved, traded, i blocked this action on events, looking for the actionId in itens and returning false if have it.
With the table, i can do it automatically, just need to add new itens to table, and the function will give the actionId by itself.
I tryed look how events work, but realy don't know C++...
I think this will be a great function to the community, opening possibilities to new Scripts.
Thanks for attencion.
I want a event function: onAddItem() that will be called when functions:
Lua:
Container:addItem()
Container:addItemEx()
Player:addItem()
Player:addItemEx()
What i realy need is: When i add a item to player or container, check if item.itemid is in table, and give a actionId to the item.
I know, i can do:
Lua:
player:addItem(8000, 1):setActionId(1000)
The itens in table, will be unique itens, that can't be droped, moved, traded, i blocked this action on events, looking for the actionId in itens and returning false if have it.
With the table, i can do it automatically, just need to add new itens to table, and the function will give the actionId by itself.
I tryed look how events work, but realy don't know C++...
I think this will be a great function to the community, opening possibilities to new Scripts.
Thanks for attencion.