25.02.2015, 05:07
Код:
stock GetClosestGasPump(playerid, &businessid, &pumpslot) { new Float: minrange = 5.0, Float: range; businessid = INVALID_BUSINESS_ID; for(new b = 0; b < MAX_BUSINESSES; b++) { for(new i = 0; i < MAX_BUSINESS_GAS_PUMPS; i++) { range = GetPlayerDistanceFromPoint(playerid, Businesses[b][GasPumpPosX][i], Businesses[b][GasPumpPosY][i], Businesses[b][GasPumpPosZ][i]); if (range < minrange) { businessid = b; pumpslot = i; minrange = range; } } } }