Getting an ID
#1

Right, I've made a stock, which will loop through the array of each dealership;
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;
}
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?
Reply


Messages In This Thread
Getting an ID - by Luis- - 29.01.2015, 18:06
Re: Getting an ID - by Sime30 - 29.01.2015, 18:10
Re: Getting an ID - by Luis- - 29.01.2015, 18:19
Re: Getting an ID - by Vince - 29.01.2015, 18:20
Re: Getting an ID - by Luis- - 29.01.2015, 19:38

Forum Jump:


Users browsing this thread: 1 Guest(s)