• Get the spread vector of the current weapon
    5 replies, posted
Would anyone know how to get the spread vector of the currently equipped weapon? I have tried [cpp] CBaseCombatWeapon* weap = GetActiveWeapon(); Vector v = weap->GetBulletSpread(); Msg("%i %i %i\n", v.x, v.y, v.z); [/cpp] which seemed to be the obvious way to do it but it gives the same erroneous result no matter which weapon is equipped: 1610612736 -1046898280 -2147483648 What's the proper way?
You should've mentioned in the title that this was about Source. Make sure you're using the right format specifiers in the Msg format string, that could be the problem (I don't know the Vector internals so I can't tell).
[QUOTE=jA_cOp;26167985]Make sure you're using the right format specifiers in the Msg format string.[/QUOTE] something else might not be right. the numbers would be 3.6893488e19, -0.22500002, and -0.0.
[QUOTE=jA_cOp;26167985]You should've mentioned in the title that this was about Source. Make sure you're using the right format specifiers in the Msg format string, that could be the problem (I don't know the Vector internals so I can't tell).[/QUOTE] Sorry, I thought it was implied, but I forgot this isn't a forum specifically for source. As for the format specifiers, I was using the wrong ones since the coordinates are float, not int, but changing the format spec to %f just gave an erroneous value as a float: -107374104.000000 -107374176.000000 -107374176.000000
Is there any documentation on what format it should be? That's really the only problem.
No, the problem is that it returns bad values [i]and[/i] those bad values do not change when I switch weapons.
Sorry, you need to Log In to post a reply to this thread.