Randomizing a "FLOAT" (newb)
Well, I'm working on a semi-public hack and I was wondering if someone could help me randomize this float?
Code:
BOOL CEngine::AimAtRandom(CPlayer* pTarget, BOOL bRandomShot)
{
CPlayer* LocalPlayer = PlayerList->GetLocalPlayer();
Vec3f vAimMod = Vec3f(0.0f, 0.0f, 0.0f);
int randmin = 0.2f; //minimum of the randomization
int randmax = 0.7f; //maximum of the randomization
if(LocalPlayer != NULL) {
if(pTarget->IsCrouching) {
vAimMod.z += 0.4f;
}
if(!bRandomShot) {
if(pTarget->IsCrouching) {
vAimMod.z += 0.2f;
}
else {
vAimMod.z += 0.5f;
}
}
Vec3f vNewAim = ((pTarget->Camera + vAimMod) - LocalPlayer->Camera);
vNewAim.ModifyDirection(LocalPlayer->VForward, LocalPlayer->VUp, LocalPlayer->VRight);
return TRUE;
}
return FALSE;
}
Brother of mine won't bother to help me since he's the one that's being doing it for me these past few days and I've been learning from him so, yeah.
Theory ;
Basically what I'm trying to do is for that each time I aim at the enemy it'll randomize the location of where it's going to aim at. I just can't remember how my brother did this, he did a bonescan as well but I'm a noob and can't keep up.