How does prediction work?
This is only for SP.
I've made a hack (without CG_Trace cuz that's a bitch and always returns 1) and I want to add prediction even if it has bone aiming for spot on shots. Problem is that I don't understand how prediction works if you're playing alone since in MP you would do something like use the ping but in SP what would you use? I found something that looks like player velocity in gentity_s but the values appear and disappear fast so I have no use of that and how I can use it.
Any ideas?
Prediction is pretty useless in both cases, MP and SP. Especially in SP, you don't even have to optimize your aimbot in order to get a good hitrate without any kind of prediction.
Still, a simple prediction would for example calculate the targets movement and then aim a little bit in front of the target. It might help a little bit with high pings, but is by far not the best solution. My own MP bot doesn't use any prediction, and it is hitting pretty badass, so I recommend you to do some research / RCE about the game's engine & structure. You'll find out more by time, good luck!