17.07.2016, 01:11
Try changing the loop to something like this (note that I didn't test this):
pawn Код:
new closestspawn = -1;
for(new i = 0; i < sizeof(spawndist); i++)
{
if(closestspawn == -1 && spawndist[i] < distance)
{
closestspawn = i;
continue;
}
else if(closestspawn != -1 && closestspawn != i)
{
if(spawndist[i] < spawndist[closestspawn])
{
closestspawn = i;
continue;
}
else continue;
}
}