Custom entity key values are getting reset on map loading

I implement some custom entities for maps. If this can help in some way, one of them is filter entity.
I added code in filter initialization to print all of its key values.
And when in hammer I see value 3 on one key, on the same key in game I see value 0.
I even looked in bsp file, this key there also has value 3. So there is no problem with map compilation.

What Garry’s Mod is doing and how to fix it?

Help, Please???

What are you using to see the key values in game? Because what you should be using is http://wiki.garrysmod.com/page/ENTITY/KeyValue

Ooh. Didn’t know about that. Thanks for the answer, I will try to use this hook.

[editline]4th November 2016[/editline]

It works!!! Finally
Thanks, Robotboy