PDA

View Full Version : Little stuck...

MasterB
31/12/2011, 02:41 AM
I forgot how to do this in pawno can i get some help please?

this is in the begin of the gm

new Float:FuelPumps[][3];

and i wanna add locations X, Y, Z later to this variable
like:

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?

SuperViper
31/12/2011, 04:03 AM
new Float: FuelPumps[][3] = {
{0.0, 0.0, 0.0},
{0.0, 0.0, 0.0}
};

[ABK]Antonio
31/12/2011, 04:10 AM
Like viper said

new Float: FuelPumps[][3] = {
{0.0, 0.0, 0.0},
{0.0, 0.0, 0.0}
};

but...

#define MAX_FUEL 2 //We will use this later

new Float:FuelPumps[MAX_FUEL][3] = {
{0.0, 0.0, 0.0},
{0.0, 0.0, 0.0}
}

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

SuperViper
31/12/2011, 04:12 AM
MAX_FUEL isn't needed. Use sizeof(FuelPumps) for the loop.

[ABK]Antonio
31/12/2011, 04:13 AM
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

MasterB
31/12/2011, 02:12 PM
Thnx but i know that way but i wanna add cords to it later with like a command

MasterB
31/12/2011, 04:09 PM
Can anyone help since im stuck at this point???