29.11.2013, 09:56
This should work
And to check if the player is near a station and return the price..
pawn Код:
stock GetActuallyFuelPrice(FuelStation) return fuel[FuelStation][Price];
pawn Код:
stock GetPlayersNearestFuelStationPrice(playerid)
{
for(new i=0; i<MAX_FUEL_STATIONS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 10, fuel[i][f_X], fuel[i][f_Y], fuel[i][f_Z]) // If the player is near any of the stations by 10 units..
{
return fuel[FuelStation][Price]; // Return to Price of that station | OR..
//return i; This to return the station's id, If you want to return the station's id..
}
}
return -1;
}