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

Hello,
i making fuel stations with randomize price of fuel as you can see.

pawn Код:
#define MAX_FUEL_STATIONS 10
new fStations = 0;
enum FuelStations
{
Float:f_X,
Float:f_Y,
Float:f_Z,
Price
}
new fuel[MAX_FUEL_STATIONS][FuelStations];
pawn Код:
stock AddFuelStation(Float:x, Float:y, Float:z)
{
    fStations++;
    if(fStations > MAX_FUEL_STATIONS) return print("MAX_FUEL_STATIONS > 10 !");
    fuel[fStations][f_X] = x;
    fuel[fStations][f_Y] = y;
    fuel[fStations][f_Z] = z;
    fuel[fStations][Price] = RandomEx(15, 30);
    printf("Fuel station id %i have price %i $", fStations, fuel[fStations][Price]);
    return 1;
}
So for example
Код:
Fuel station id 1 have price 22 $
Код:
Fuel station id 2 have price 25 $
etc..

And my question is: How to make e.g. GetActuallyFuelPrice() - return fuel price where player is(maybe by fStations?).

Edit: I trying something like that, is that correct? >
pawn Код:
stock GetActuallyFuelPrice() return fuel[fStations][Price];
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)