theralio said:is it hard
supahdupahnubah said:theralio said:is it hard
Nope
void stopper()
{
float myPos [3] = GetXYInFront(botgetposition(), 5.0);
for (int x = 0; x < 2000; x++) {
if(isValidVehicle(x))
{
float vPos [3] = x.getPosition();
if(checkDistance(myPos, vPos) < 7.5)
{
stopBot();
return;
}
}
}
}
[code]double checkDistance(float posArray1[3], float posArrow2[3])
{
distance = sqrt(pow((posArray1[0] - posArray2[0]), 2) + pow((posArray1[1] - posArray2[1]), 2) + pow((posArray1[2] - posArray2[2]), 2));
return(distance);
}