Make players unable to hold items in hands?

Hi, I am trying to make something similar to the safe zones where you cannot draw weapons, however I want it to work with every item, so you can't take anything out in your hand. Does anyone know a way to do this?

Just return a non-null value from the hook.

gbG3xoeyceBT9tj.png 0x89A

Just return a non-null value from the hook.

I did this and it does nothing.

object OnActiveItemChange(BasePlayer player, Item oldItem, uint newItemId)
        {
            
            return true;
        }

I am trying to use the onactiveitemchange hook to not alllow a player to change weapon. The hook states that returning a non null will cancel defauIt behaviour. I am using it like this,

object OnActiveItemChange(BasePlayer player, Item oldItem, uint newItemId)
        {

            return true;
        }​

when changing weapons it gets stuck in a loop, if you were to add

Puts("Hello");

then it would print this forever. Is the hook broken or am I just not using it as its intended?

As far as I know, there is nothing to prevent players from changing their weapons. It should be handled on the client-side