29.01.2015, 18:06
Right, I've made a stock, which will loop through the array of each dealership;
As you can see i'm "returning i" but that's not working so, how would I actually get what dealership the player is near?
pawn Код:
stock GetNearestDealership(playerid) {
for(new i = 0; i != sizeof Dealerships; i++) {
if(IsPlayerInRangeOfPoint(playerid, 5.0, Dealerships[i][0], Dealerships[i][1], Dealerships[i][2])) {
return i;
}
}
return 1;
}