[Help] > Prices for fuel stations..
#3

This should work
pawn Код:
stock GetActuallyFuelPrice(FuelStation) return fuel[FuelStation][Price];
And to check if the player is near a station and return the 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;
}
Reply


Messages In This Thread
[Help] > Prices for fuel stations.. - by Jacapo - 27.11.2013, 10:07
Re: [Help] > Prices for fuel stations.. - by Jacapo - 29.11.2013, 09:39
Re: [Help] > Prices for fuel stations.. - by xVIP3Rx - 29.11.2013, 09:56
Re: [Help] > Prices for fuel stations.. - by Jacapo - 29.11.2013, 11:24

Forum Jump:


Users browsing this thread: 1 Guest(s)