Little stuck...
#1

I forgot how to do this in pawno can i get some help please?

this is in the begin of the gm
pawn Код:
new Float:FuelPumps[][3];
and i wanna add locations X, Y, Z later to this variable
like:
pawn Код:
dcmd_fill(playerid, params[])
{
    #pragma unused params
    FuelPumps[] = {-1.000,3.000,24.00};  //random cords
    return 1;
}
what is the correct way to do it?
Reply
#2

pawn Код:
new Float: FuelPumps[][3] = {
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
};
Reply
#3

Like viper said
pawn Код:
new Float: FuelPumps[][3] = {
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
};
but...
pawn Код:
#define MAX_FUEL 2 //We will use this later
pawn Код:
new Float:FuelPumps[MAX_FUEL][3] = {
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
}
pawn Код:
for(new i; i<= MAX_FUEL; i++)
{
    if(IsPlayerInRangeOfPoint (playerid, 5,FuelPumps[i][0], FuelPumps[i][1],FuelPumps[i][2]))
}
EDIT: woops...(IsPlayerInRangeOfPoint not IsPlayerInPointOfRange
Reply
#4

MAX_FUEL isn't needed. Use sizeof(FuelPumps) for the loop.
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
MAX_FUEL isn't needed.
Then if you're creating a loop you'll just be using a number..like 2..It isn't really necessary, it's just a define that we can put max gas stations in instead of always typing the number using sizeof(FuelPump) = more typing anyway :P
Reply
#6

Thnx but i know that way but i wanna add cords to it later with like a command
Reply
#7

Can anyone help since im stuck at this point
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)