20.05.2011, 12:09
forward GetClosestVeh(v1);
public GetClosestVeh(v1) {
new x,Float:dis,Float:dis2,player;
player = -1;
dis = 99999.99;
for (x = 0; x < MAX_VEHICLES; x++) {
if(x != v1) {
dis2 = GetDistanceBetweenPV(x,v1);
if(dis2 < dis && dis2 != -1.00) {
dis = dis2; player = x; } } } return player; }
public GetClosestVeh(v1) {
new x,Float:dis,Float:dis2,player;
player = -1;
dis = 99999.99;
for (x = 0; x < MAX_VEHICLES; x++) {
if(x != v1) {
dis2 = GetDistanceBetweenPV(x,v1);
if(dis2 < dis && dis2 != -1.00) {
dis = dis2; player = x; } } } return player; }

