EDIT: Problem #2 solved. Code removed because no help received.
EDIT: Problem #3 solved-ish by using a custom velocity by aim stock that supports floats.
EDIT: Problem #1 solved by creating the entity in plugin_cfg instead of plugin_init.
So I made this little plugin which uses a single camera entity for all the players by modifying its information in AddToFullPack for each of them and I have a bunch of problems with it.
1. It doesn't render invisible unless I do it in AddToFullPack which wouldn't make sense and would be a waste of resources. I tried spawning it, using different orders of render and other properties but nothing worked. Model is mandatory otherwise it won't work properly.
2. Since I fake its origin to the player's, its real origin is 0, 0, 0 therefore that's it's PVS zone so when the player view is attached to it he only receives information from the entities in that real origin.
If he is in another PVS than that of the camera, the entities around him do not render. Any way to fix this?
3. The camera movement is kinda sloppy. When you move it slowly you can see it "jumping pixels", and even more when TraceLine is used to distance it from a hit entity. I suspect this is because of the "velocity_by_aim" native which uses and integer instead of a float like all of the other variables in its calculations. Not a big problem though but would be nice to be smoother.
Here's the code. Thanks in advance for your help.
bitsums.inc
__________________