Cancelling an event from being fired?Solved
Hi, I was trying to make a plugin that disallow to drop any item in a region. But I don't know how to cancel an event or if it's even possible. How can I do that ? Thanks in advance.
Are you talking about native game events or plugins?
In response to klauz24 ():
Are you talking about native game events or plugins?
Native one's. Like when I pickup or drop something it just cancel it. Is that possible ?
In response to ZeTioZ ():
Native one's. Like when I pickup or drop something it just cancel it. Is that possible ?
Not without a hook generally.
In response to Wulf ():
Not without a hook generally.
Anyone could give an example on how I could do it ?
object OnItemDrop(Inventory inventory, int slot)
{
    Puts("Let's prevent item from dropping as this is an object hook that can return");
    return true;
}
In response to Wulf ():
object OnItemDrop(Inventory inventory, int slot){ Puts("Let's prevent item from dropping as thi...

Lol that was so easy... Thanks for helping such a noob guy ^^'

Just a little precision, if I "return false" then it will still drop ? or it will still be blocked ?

In response to ZeTioZ ():
Lol that was so easy... Thanks for helping such a noob guy ^^'Just a little precision, if I "return...
return true deny it, returning null would do nothing
Locked automatically